vbs循环产生的参数的传递问题
程序员文章站
2022-06-23 21:17:16
set objfso = createobject("scripting.filesystemobject") set ...
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
这个只传递一次就完了