标题: 启动脚本删除WINDOWS 自带的游戏 [打印本页] 作者: bensonchen 时间: 2007-2-9 11:51 标题: 启动脚本删除WINDOWS 自带的游戏 求助如何写一个批处理脚本,然后作为一个启动脚本,删除公司所有电脑windows 自带的游戏,电脑系统有windows 2000,也有windows xp.作者: stdmis 时间: 2007-2-9 15:48
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作者: auspicious 时间: 2007-2-10 08:34
支持樓上,雖然自己不能寫,還是要頂下。作者: tomato 时间: 2007-2-10 09:27
谢谢!我正在找这个