Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 214
  • Last Modified:

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?
0
deltatuk
Asked:
deltatuk
1 Solution
 
P1Commented:
Shell "C:\MyProg.exe -y ""value to search for"" -r """ & Trim("some text   ") & """

Enjoy your work,  P1
0
 
aelatikCommented:
You mean something like this ?

Dim Var1
Var1 = Inputbox("Your var")
Shell "app.exe -y=asdfasdfasdf -r=" & Var1
0
 
P1Commented:
Or

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

Enjoy your work,  P1
0
 
FlamerCommented:
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
0
 
deltatukAuthor Commented:
Worked perfectly. Thanks for your help.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now