set FSO = createobject(" scripting . file system object ")
set ws = createobject(" wscript . shell ")
checkpath路徑,返回
如果return=0並且FSO . file存在(path & amp" yglzj.exe ")然後
刪除文件路徑。" yglzj.ini "
wscript.sleep 2000
ws.exec路徑& amp" yglzj.exe "
其他
locateforfile()
如果…就會結束
私有函數checkpath(path,return)
return=0
如果FSO . file存在(" c:\windows\path.txt "),則
Set stm = CreateObject("Adodb。流”)
stm。類型= 2
stm.mode = 3
stm.charset ="Unicode "
stm。打開
STM . loadfromfile " c:\ windows \ path . txt "
path = stm.readtext
stm。關閉
如果路徑=空,則
return=1
其他
路徑=路徑
如果…就會結束
其他
return=1
如果…就會結束
結束功能
私有函數BrowseForFile()
set objDialog = CreateObject(" user accounts。CommonDialog”)
objDialog。Filter ="yglzj.ini|*。ini "
objDialog。InitialDir ="C:\ "
objDialog。Flags = & amph 80000+& amp;H4+& amp;H8
intResult = objDialog。ShowOpen
BrowseForFile = objDialog。文件名
結束功能
私有函數locateforfile()
set file = FSO . getfile(BrowseForFile())
set paths = FSO . create textfile(" c:\ windows \ path . txt ",2,true)
path=StrReverse(文件)
s=instr(1,路徑," \ ")
path=StrReverse(mid(path,s,len(path)- s + 1))
路徑.寫入路徑
路徑.關閉
fso.deletefile文件
wscript.sleep 2000
ws.exec路徑& amp" yglzj.exe "
結束功能