level 9
图标缓存从xp到win7一直很蛋疼的……目前没有太好的办法……重启explorer吧……另外……上Q!
2011年09月18日 05点09分
2
level 9
const HK_CR = &H80000000
const HK_CU = &H80000001
const HK_LM = &H80000002
dim srp, fso, wsh
set srp = GetObject("winmgmts:root\default:StdRegProv")
set fso = CreateObject("Scripting.FileSystemObject")
set wsh = CreateObject("WScript.Shell")
dim ps, pss
set pss = GetObject("winmgmts:root\cimv2:win32_process").instances_
for each ps in pss
if ps.name = "explorer.exe" then
ps.terminate
end if
next
set pss = nothing
wscript.sleep 200
dim waitdata
if srp.GetDWORDValue(HK_LM, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoRestartShell", waitdata) = 0 then
if waitdata = 1 then
waitpsrunning "explorer.exe"
end if
dim appexec
set appexec = wsh.Exec("explorer.exe" +" "+ fso.GetFile(Wscript.ScriptFullName).ParentFolder)
wsh.AppActivate appexec.ProcessID
set appexec = nothing
end if
set wsh = nothing
set fso = nothing
set srp = nothing
function waitpsrunning(pName)
dim ps, pss, psexist, pscheck
for pscheck = 1 to 50 step 1
psexist = false
set pss = GetObject("winmgmts:root\cimv2:win32_process").instances_
for each ps in pss
if ps.name = pName then
psexist = true
end if
next
set pss = nothing
if psexist = true then
waitpsrunning = true
exit function
end if
wscript.sleep 100
next
waitpsrunning = false
end function
会修改注册表什么的……为了速度……咳咳……
2011年09月18日 05点09分
3