How to delete windows game with batch file

Posted on 2009-02-15
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
    LVL 9

    Expert Comment

    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

    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

    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.

    LVL 27

    Expert Comment

    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

    That worked great, thanks
    LVL 11

    Expert Comment

    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

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Issue: Unstable cursor in Windows XP and Windows runs extremely slow in that any click will bring up the Hour glass (sometimes for several seconds before giving you what you want) . Troubleshooting Process and the FINAL FIX: This issue see…
    If you have done a reformat of your hard drive and proceeded to do a successful Windows XP installation, you may notice that a choice between two operating systems when you start up the machine. Here is how to get rid of this: Click Start Clic…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    734 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

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now