Answer the question
In order to leave comments, you need to log in
How to pass a variable as an argument to another program in VBS?
Good afternoon. You need to run the program with an argument. Argument is a variable from the vbs script
A piece of code:
Dim driveleter
driveleter = Array("J:","K:","L:","M:","N:","O:","P:","Q:","R:","S:","T:")
ii=1
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "cmd.exe /c read.cmd", 0, false
ii=ii+1
WshShell.Run "cmd.exe /c read.cmd driveleter(ii)", 0, false
Answer the question
In order to leave comments, you need to log in
WshShell.Run "cmd.exe /c read.cmd " & driveleter(ii), 0, false
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question