vbs循環(huán)產生的參數(shù)的傳遞問題
更新時間:2008年06月09日 23:08:17 作者:
用vbs實現(xiàn)循環(huán)產生參數(shù)的傳遞問題,建議大家測試學習
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("d:\1\0.txt", 1)
set WshShell = WScript.CreateObject("WScript.Shell")
strFolder = "d:\1\"
Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
filename = strLine
Set objFile = objFSO.GetFile(filename)
set oShellLink = WshShell.CreateShortcut(strFolder & objFSO.GetBaseName(filename) & ".lnk")
oShellLink.TargetPath = objFile
oShellLink.WindowStyle = 1
oShellLink.WorkingDirectory = objFSO.GetParentFolderName(filename)
oShellLink.Save
Loop
objFile.Close
這個只傳遞一次就完了
Set objFile = objFSO.OpenTextFile("d:\1\0.txt", 1)
set WshShell = WScript.CreateObject("WScript.Shell")
strFolder = "d:\1\"
Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
filename = strLine
Set objFile = objFSO.GetFile(filename)
set oShellLink = WshShell.CreateShortcut(strFolder & objFSO.GetBaseName(filename) & ".lnk")
oShellLink.TargetPath = objFile
oShellLink.WindowStyle = 1
oShellLink.WorkingDirectory = objFSO.GetParentFolderName(filename)
oShellLink.Save
Loop
objFile.Close
這個只傳遞一次就完了
相關文章
利用wscript執(zhí)行文件[包括可執(zhí)行exe文件]vbs腳本
利用wscript執(zhí)行文件[包括可執(zhí)行exe文件]vbs腳本...2007-02-02VBS 強制關閉Symantec Endpoint Protection的代碼
很多企業(yè)電腦系統(tǒng)是Windows Xp,使用Windows server 2003 來控制,其中客戶端得殺毒軟件有不少是使用 Symantec Endpoint Protection2013-01-01VBScript Enun Remote CMD Shell代碼
Enun Remote CMDShell,喜歡玩cmdshell的朋友可以參考下2013-07-07