Hack 66 Remove Windows Components from the Command Line

 < Day Day Up > 

Hack 66 Remove Windows Components from the Command Line

figs/beginner.gif figs/hack66.gif

Here's a handy utility you can use from the command line to remove Windows components and protected files .

When asked to remove simple game files from a company's workstations, I replied quickly that it would not be a problem. After all, how tough could it be to delete four executables and their shortcuts? Well, on Windows 2000/XP machines, it can be a little difficult. When you try to delete the files, the OS will see that those files are missing and will replace them (or restrict you from deleting them). Why the files sol.exe , freecell.exe , and so on are considered critical system files is beyond me, but in order to get rid of them you will need to use the sysocmgr.exe utility.

The sysocmgr.exe tool is used to add or remove windows components. This utility takes advantage of an answer.txt file that can be scripted and pushed via Systems Management Server (SMS) and other methods . For the purposes of this hack, we will use the answer.txt to remove four famous games from the computer. In our case, the answer.txt file will look something like this:

 [Components] solitaire = off freecell = off pinball = off minesweeper = off 

The utility will parse only the [Components] and [NetOptionalComponents] sections of the file, so you can easily wrap it in with other answer files or inf files.

Running the Hack

The command line for the utility has several switches, but these are the most important ones for our example:


/i

The location of the inf for sysocmgr.exe . This is different than the answer file and is normally in the System32 directory.


/q

Runs the utility in quiet mode to suppress prompts.


/r

Suppresses a reboot (if required).


/u

Specifies the location of the answer (unattended) file.


/w

Prompts the user to reboot instead of rebooting automatically (if required).

Putting it all together, our command line to remove the games components on Windows 2000/XP machines looks like this:

 sysocmgr /i:c:\winnt\inf\sysoc.inf /u:c:\UnattendSetup\answer.txt /q 

Removing these four games does not require a reboot, so we didn't bother to put in the any of the reboot switches.

Hopefully, this will prove useful in your environment; but, as always, test first.

Donnie Taylor

 < Day Day Up > 


Windows Server Hacks
Windows Server Hacks
ISBN: 0596006470
EAN: 2147483647
Year: 2004
Pages: 163
Authors: Mitch Tulloch

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net