龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > 软件开发 > VB开发 >

vbs循环产生的参数的传递问题

时间:2014-07-01 15:01来源:网络整理 作者:网络 点击:
分享到:
用vbs实现循环产生参数的传递问题,建议大家测试学习
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

这个只传递一次就完了
精彩图集

赞助商链接