开发者

VBS Add numbers for each loop

开发者 https://www.devze.com 2023-03-18 21:21 出处:网络
For my VBS script, for e开发者_StackOverflow社区ach loop, I want it to add the number of which loop it\'s on. Like if it\'s a site and has an ID, then if it\'s on loop 1 adds 1 to the ID. I already de

For my VBS script, for e开发者_StackOverflow社区ach loop, I want it to add the number of which loop it's on. Like if it's a site and has an ID, then if it's on loop 1 adds 1 to the ID. I already declared "site" for my script.

What do I do? Do you need to see some of the script?


Not sure what kind of collection you're working with, but you could do something simple like this

Set objFilesystem = CreateObject("Scripting.FileSystemObject")
Set objInputFolder = objFileSystem.GetFolder("c:\temp")

i = 1
For Each objInputFile In objInputFolder.Files
   WScript.Echo SITE + i
   i = i + 1
Next 
0

精彩评论

暂无评论...
验证码 换一张
取 消