If you have some special group of desktop shared by a team, you may have the similar issue as me that the hard disk space used up quickly simply because of the temp file (like the ost file of outlook).
I have written a script to monitor the freespace of a few machines...
First of all, I create a freespace.bat file like this
----start of freespace.bat-----
@echo off
for /f "usebackq delims== tokens=2" %%x in (`wmic /node:%1 logicaldisk where "DeviceID='C:'" get FreeSpace /format:value`) do (set tx1234=%%x)
for /f "usebackq delims== tokens=2" %%x in (`wmic /node:%1 logicaldisk where "DeviceID='C:'" get Size /format:value`) do (set txsi=%%x)
echo %1;%tx1234%;%txsi%
----end of freespace.bat-----
This script basically will poll the PC that you specified provide the freespace and the disksize of c-drive.
The usage is like this
freespace.bat <hostname>
If you have a list of machines, then, you can simply put their hostname into a text file, e.g. deskfree.txt and then use the following batch file to check their freespace and echo the results into a text file.
----start of mon.bat-------
@echo off
del /q deskfree.txt
for /f %%y in (desk.txt) Do freespace %%y >> deskfree.txt
------end of mon.bat--------
This blog is to record down all the automation script I created to automate some manual task I have to do from day-to-day.
Wednesday, February 23, 2011
Wednesday, February 9, 2011
How to install apps from Ovi-store into your Satio Phone without hacking phone
If you are the poor Satio users like me who do not have access to Ovi-store and you want to use the latest firmware (or you have to) in order to have the full WXGA video, here's the steps you could follow to install Nokia apps while continue to get the latest update from Sony Ericsson.
1) Download and extract SISContents
2) Install Firefox in your PC and install the Add-on "User Agent Switcher"
3) Setup a new user Agent which allows you to pre-tend to be a Nokia phone. You can use the string for Nokia 5800 as below
Mozilla/5.0 (SymbianOS/9.4; U; Series60/5.0 Nokia5800d-1/10.0.008; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413
4) Next, goto the Ovi-store to download all the apps you want.
5)Then Open the siscontents file extsis.exe the file you downloaded in first step..
6) then select the sis file which you have downloaded from ovi-store
7) Now You Delete All The Signatures Present in the sis File
8) Now Select Sign Package And Follow The Following Steps
9) Now a new window will pop out to sign the sis file. You need to have a certificate and key file first for your phone. if you have not done it please read my previous post of Get You s60v5 certificate and key form OPDA. If you have the certificate and key files please continue.
10) Now After this close this window and save your new hacked sis file.
Oh.....in some case, you cannot straightly do this as the file you download from OVI-store are .dm file!!!
Some of the Ovi Store apps downloaded to PC are in DM file format. So, how to install the DM files from Ovi Store on Nokia phone?
You need to open and edit the DM file with a file editor that can deal with binary file format (i.e. hex content not ASCII). My favorite is Notepad++ (powerful open-source editor for Windows), as shown in this “silent” screencast:
- Open the DM file with Notepad++
- Move the cursor from top-left position to the beginning of “z” character and hit DELETE key – that will delete top 4 lines up to the blank space in front of “z” character, as shown in the YouTube video (above).
- Save and close the edited file.
- Remove the
.dm
file extension from file name – if the 2nd last suffix is SIS, then the converted file is in SIS file format, otherwise it is SISX file format. - Then, you can use the same method above to sign the application with your own certificate!!!
Enjoy...
Tuesday, February 1, 2011
How to check what kind of hotfix are installed in a PC
To check what kind hotfix has been installed, we could use a tool Pstools available from Microsoft.
http://technet.microsoft.com/en-us/sysinternals/bb897550
The command line is very straightforward, you simply do that by
psinfo -h
And then you will see something like this
P:\Desktop\pstools>psinfo -h
PsInfo v1.75 - Local and remote system information viewer
Copyright (C) 2001-2007 Mark Russinovich
Sysinternals - www.sysinternals.com
System information for \\x12354
Uptime: 0 days 21 hours 16 minutes 53 seconds
Kernel version: Microsoft Windows XP, Multiprocessor Free
Product type: Professional
Product version: 5.1
Service pack: 3
Kernel build number: 2600
Registered organization: Fei
Registered owner: Fei User
Install date: 8/6/2010, 8:05:42 PM
Activation status: Error reading status
IE version: 7.0000
System root: C:\WINDOWS
Processors: 2
Processor speed: 2.7 GHz
Processor type: Intel(R) Core(TM)2 Duo CPU E7400 @
Physical memory: 3292 MB
Video driver: Intel(R) 4 Series Internal Chipset
Installed HotFix
10/6/2010 Microsoft Internationalized Domain Names Mitigation APIs
10/6/2010 Microsoft National Language Support Downlevel APIs
11/11/2010 Security Update for Windows Media Player (KB2378111)
8/7/2010 Security Update for Windows Media Player (KB954155)
8/7/2010 Security Update for Windows Media Player (KB968816)
8/7/2010 Security Update for Windows Media Player (KB973540)
1/10/2010 Security Update for Windows Media Player (KB975558)
26/7/2010 Security Update for Windows Media Player (KB978695)
10/6/2010 Security Update for Windows Media Player 10 (KB917734)
8/7/2010 Security Update for Windows XP (KB941569)
8/7/2010 Security Update for Windows Internet Explorer 7 (KB974455)
8/6/2010 Windows XP Service Pack 3
4/9/2010 Security Update for Windows XP (KB2079403)
4/9/2010 Security Update for Windows XP (KB2115168)
1/10/2010 Security Update for Windows XP (KB2121546)
4/9/2010 Security Update for Windows XP (KB2160329)
29/7/2010 Security Update for Windows XP (KB2229593)
1/10/2010 Security Update for Windows XP (KB2259922)
11/11/2010 Security Update for Windows XP (KB2279986)
12/8/2010 Security Update for Windows XP (KB2286198)
......
If you are going to feed this information to an automation script so that you can consolidate all inforamtion by yourself, you can use the script like this.
del checkhotfix.txt /q
del 0123894985.txt /q
psinfo -h > 0123894985.txt
for /f "skip=18 tokens=1*" %%i in (0123894985.txt) do @echo %%i %%j >> checkhotfix.txt
This script will skip the first 18 lines of the information so you can easily import them into an access or SQL database for further analysis.
http://technet.microsoft.com/en-us/sysinternals/bb897550
The command line is very straightforward, you simply do that by
psinfo -h
And then you will see something like this
P:\Desktop\pstools>psinfo -h
PsInfo v1.75 - Local and remote system information viewer
Copyright (C) 2001-2007 Mark Russinovich
Sysinternals - www.sysinternals.com
System information for \\x12354
Uptime: 0 days 21 hours 16 minutes 53 seconds
Kernel version: Microsoft Windows XP, Multiprocessor Free
Product type: Professional
Product version: 5.1
Service pack: 3
Kernel build number: 2600
Registered organization: Fei
Registered owner: Fei User
Install date: 8/6/2010, 8:05:42 PM
Activation status: Error reading status
IE version: 7.0000
System root: C:\WINDOWS
Processors: 2
Processor speed: 2.7 GHz
Processor type: Intel(R) Core(TM)2 Duo CPU E7400 @
Physical memory: 3292 MB
Video driver: Intel(R) 4 Series Internal Chipset
Installed HotFix
10/6/2010 Microsoft Internationalized Domain Names Mitigation APIs
10/6/2010 Microsoft National Language Support Downlevel APIs
11/11/2010 Security Update for Windows Media Player (KB2378111)
8/7/2010 Security Update for Windows Media Player (KB954155)
8/7/2010 Security Update for Windows Media Player (KB968816)
8/7/2010 Security Update for Windows Media Player (KB973540)
1/10/2010 Security Update for Windows Media Player (KB975558)
26/7/2010 Security Update for Windows Media Player (KB978695)
10/6/2010 Security Update for Windows Media Player 10 (KB917734)
8/7/2010 Security Update for Windows XP (KB941569)
8/7/2010 Security Update for Windows Internet Explorer 7 (KB974455)
8/6/2010 Windows XP Service Pack 3
4/9/2010 Security Update for Windows XP (KB2079403)
4/9/2010 Security Update for Windows XP (KB2115168)
1/10/2010 Security Update for Windows XP (KB2121546)
4/9/2010 Security Update for Windows XP (KB2160329)
29/7/2010 Security Update for Windows XP (KB2229593)
1/10/2010 Security Update for Windows XP (KB2259922)
11/11/2010 Security Update for Windows XP (KB2279986)
12/8/2010 Security Update for Windows XP (KB2286198)
......
If you are going to feed this information to an automation script so that you can consolidate all inforamtion by yourself, you can use the script like this.
del checkhotfix.txt /q
del 0123894985.txt /q
psinfo -h > 0123894985.txt
for /f "skip=18 tokens=1*" %%i in (0123894985.txt) do @echo %%i %%j >> checkhotfix.txt
This script will skip the first 18 lines of the information so you can easily import them into an access or SQL database for further analysis.
How to extract all email distribution list from Active Directory
This is a script that I used to extract all distribution list from Active Directory. You can use a tool called csvde.exe from Microsoft to do this job easily.
csvde -f c:\temp\yourdl.csv -p subtree -l cn,mail,displayName,managedBy -r "(|(&(objectCategory=Group)(objectClass=Group)(|(groupType=8)(groupType=4)(groupType=2)))(objectCategory=ms-Exch-Dynamic-Distribution-List)(objectClass=msExchDynamicDistributionList))" -j c:\temp -s <your domain>
You should replace <your domain> with your company's domain information
csvde -f c:\temp\yourdl.csv -p subtree -l cn,mail,displayName,managedBy -r "(|(&(objectCategory=Group)(objectClass=Group)(|(groupType=8)(groupType=4)(groupType=2)))(objectCategory=ms-Exch-Dynamic-Distribution-List)(objectClass=msExchDynamicDistributionList))" -j c:\temp -s <your domain>
You should replace <your domain> with your company's domain information
Subscribe to:
Posts (Atom)