How to delete windows game with batch file

Posted on 2009-02-15
Medium Priority
Last Modified: 2012-05-06
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?
Question by:DavidNPD

Expert Comment

ID: 23645259
create a batch file,
something like this,

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

and run the batch file
thanks hope this helps

Author Comment

ID: 23645264
As my post advised, that was my first attempt. The games are protected windows files, a simple bat file does not work.
LVL 27

Accepted Solution

bluntTony earned 200 total points
ID: 23645266
To remove the windows games component permanently, you can run this vbscript:

Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")
Set WshShell = WScript.CreateObject("WScript.Shell")
sPrograms = WshShell.SpecialFolders("AllUsersPrograms")
If (Fso.FolderExists(sPrograms & "\Games")) Then
 ' Create file for uninstalling games
 Set f = Fso.CreateTextFile("c:\windows\inf\wmdtocm.txt", True)
 WshShell.Run "sysocmgr.exe /i:c:\windows\inf\sysoc.inf /u:""c:\windows\inf\wmdtocm.txt"" /q", 1, True
 Fso.DeleteFolder(sPrograms & "\Games"), True
End If

Works in XP and will remove all the built-in games from the system.

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 27

Expert Comment

ID: 23645285
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

Author Comment

ID: 23646361
That worked great, thanks
LVL 11

Expert Comment

ID: 24154855
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 :)

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is only natural that we all want our PCs to be in good working order, improved system performance, so that is exactly how programs are advertised to entice. They say things like:            •      PC crashes? Get registry cleaner to repair it!    …
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question