Link to home
Start Free TrialLog in
Avatar of deltatuk
deltatuk

asked on

Shell Command Question

I am needing to run a program called regfind that needs the following swithes: -y "value to search for" -r "value to change to". The value to search for is hard coded, but I want to be able to set the value to be changed to to be input by the user. How can I call a variable inside the shell command?
Avatar of P1
P1
Flag of United States of America image

Shell "C:\MyProg.exe -y ""value to search for"" -r """ & Trim("some text   ") & """

Enjoy your work,  P1
Avatar of aelatik
You mean something like this ?

Dim Var1
Var1 = Inputbox("Your var")
Shell "app.exe -y=asdfasdfasdf -r=" & Var1
ASKER CERTIFIED SOLUTION
Avatar of P1
P1
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you want to read user input from the command line, simply use the Command() function (built in), example:

strTemp = Command

So when you program is run at the command line, if thats what you mean, Command will contain anything entered by the used after your program:

c:\>myprog.exe blah

Command = blah

Flamer
Avatar of deltatuk
deltatuk

ASKER

Worked perfectly. Thanks for your help.