Article ID: 203492
Article Last Modified on 2/12/2007
Cscript \\<server>\<share>\NOGAMES.VBS //T:5 //BWhere <server> is the name of the server and <share> is the name of the share. //T:5 Terminates the script after five seconds if it is still running. //B Tells the script to run in non-interactive mode.
' NOGAMES.VBS removes games from Add/Remove under Windows setup
' Windows 95 requires Windows Script Host to run the script.
' Windows Script Host is built into Windows 98
Const ForReading = 1, ForWriting = 2, ForAppending = 8
'*** The following 3 lines get the path of the INF folder
Set WSHShell = WScript.CreateObject("WScript.Shell")
Set WshSysEnv = WshShell.Environment("PROCESS")
INFfolder = WshSysEnv("WINDIR") & "\INF"
'*** The applet function returns the name of the INF
'*** that has the game section based on Windows version.
Function Applet()
WinVerPath = _
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\VersionNumber"
On Error Resume Next
WinVer = WSHShell.RegRead(WinVerPath)
If WinVer = "4.00.950" then
Applet = INFfolder & "\APPLETS" 'Win95 or Win95a
ElseIf WinVer = "4.00.1111" then
Applet = INFfolder & "\APPLETS" 'Win95b or Win95c
ElseIf WinVer = "4.10.1998" then
Applet = INFfolder & "\APPLETPP" 'Win98
ElseIf WinVer = "4.10.2222" then
Applet = INFfolder & "\APPLETPP" 'Win98 Second Edition
Else
WScript.Quit 'Unknown version exit script
End If
End Function
'*** The following section copies the file to be modified
'*** to *.bak then recreates the original file with [nogames]
Set fs = CreateObject("Scripting.FileSystemObject")
File1 = Applet() & ".INF" 'path and file with [games]
File2 = Applet() & ".BAK" 'name of backup file.
fs.copyfile file1, file2 'copy file1 to file2
Set A = fs.OpenTextFile(File2, ForReading, False)
Set b = fs.CreateTextFile(File1, True)
Do While a.AtEndOfStream <> True
textline = a.ReadLine
if StrComp(trim(textline), "[GAMES]", vbTextCompare)=0 then
textline ="[NOGAMES]"
end if
b.WriteLine textline
Loop
a.Close
b.Close
For additional information about how to determine which folder Windows is installed in, click the article number below
to view the article in the Microsoft Knowledge Base:
305792 How to Determine Which Folder Windows Is Installed In
Additional query words: Freecell hearts minesweeper solitaire games
Keywords: kbhowto KB203492