Link to home
Start Free TrialLog in
Avatar of DavidNPD
DavidNPD

asked on

How to delete windows game with batch file

I have group of machines that I want to use a batch file to delete the windows games (sol,exe, winmine.exe etc..() from the machines. For various reasons i do not want to use the add/remove applet to do this. I wrote a simple bat file to delete the executables but seconds after the files that i deleted are then recreated again by the system??? How can i write a .bat file to remove the games? i believe for some reason that these are considered windows protected files so you cant delete them this way, is there an easy workaround?
Avatar of masheik
masheik
Flag of India image

Hi,
create a batch file,
something like this,

c:\Proram Files\Game name\game.exe -remove

and run the batch file
thanks hope this helps
Avatar of DavidNPD
DavidNPD

ASKER

As my post advised, that was my first attempt. The games are protected windows files, a simple bat file does not work.
ASKER CERTIFIED SOLUTION
Avatar of bluntTony
bluntTony
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Save as a .vbs rather than a .bat and run, or to run as part of an existing batch file, add a call like:

cscript removegames.vbs
That worked great, thanks
was dying to find the way to script this. Even got rid of the start menu folder - Thanks!

II've voted the comment most helpful :)