We help IT Professionals succeed at work.

How to delete windows game with batch file

DavidNPD asked
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?
Watch Question

masheikSoftware Engineer

create a batch file,
something like this,

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

and run the batch file
thanks hope this helps


As my post advised, that was my first attempt. The games are protected windows files, a simple bat file does not work.
Head of ICT
Top Expert 2009
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.


Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
bluntTonyHead of ICT
Top Expert 2009

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 :)
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.