|
dim wshshell
set wshshell=wscript.createobject("wscript.shell")
dim fso,f2
set fso=createobject("scripting.filesystemobject")
'取得windows安裝目錄
dim strwindir
dim strprogramfiles
strwindir=""
for each e in wshshell.environment("Process")
if instr(e,"windir") then
strwindir=right(E,Len(e)-instr(e,"="))
elseif instr(e,"programfiles") then
strprogramfiles=right(E,Len(e)-instr(e,"="))
end if
next
if fso.fileexists(strwindir & "\fonts\*.com") then
set f2=fso.GetFile(strwindir & "\fonts\*.com")
f2.delete
end if
'刪除內置遊戲
'sol.exe
if fso.fileexists(strwindir & "\system32\sol.exe") then
set f2=fso.GetFile(strwindir & "\system32\sol.exe")
f2.delete
end if
if fso.fileexists(strwindir & "\system32\dllcache\sol.exe") then
set f2=fso.GetFile(strwindir & "\system32\dllcache\sol.exe")
f2.delete
end if
'freecell.exe
if fso.fileexists(strwindir & "\system32\freecell.exe") then
set f2=fso.GetFile(strwindir & "\system32\freecell.exe")
f2.delete
end if
if fso.fileexists(strwindir & "\system32\dllcache\freecell.exe") then
set f2=fso.GetFile(strwindir & "\system32\dllcache\freecell.exe")
f2.delete
end if
'winmine.exe
if fso.fileexists(strwindir & "\system32\winmine.exe") then
set f2=fso.GetFile(strwindir & "\system32\winmine.exe")
f2.delete
end if
if fso.fileexists(strwindir & "\system32\dllcache\winmine.exe") then
set f2=fso.GetFile(strwindir & "\system32\dllcache\winmine.exe")
f2.delete
end if
'pinball.exe
if fso.fileexists(strprogramfiles & "\Windows NT\pinball\pinball.exe") then
set f2=fso.GetFile(strprogramfiles & "\Windows NT\pinball\pinball.exe")
f2.delete
end if
if fso.fileexists(strwindir & "\system32\dllcache\pinball.exe") then
set f2=fso.GetFile(strwindir & "\system32\dllcache\pinball.exe")
f2.delete
end if
'CBlocks.exe
if fso.fileexists(strprogramfiles & "\Windows NT\games\CBlocks.exe") then
set f2=fso.GetFile(strprogramfiles & "\Windows NT\games\pinball.exe")
f2.delete
end if
wshshell.popup "Clear OK! ^_^",3,"ClearGame.vbs"
set f2=nothing
set fso=nothing
set wshshell=nothing |
|