How to realize the parameter transfer generated by the loop by vbs
Editor to share with you how to achieve vbs loop generated parameter transmission, I believe that most people do not know much about it, so share this article for your reference, I hope you will learn a lot after reading this article, let's go to understand it!
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
This will only be passed once.
These are all the contents of the article "how to pass parameters generated by the loop in vbs". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!