Shell Command Question

Posted on 2003-03-27
Medium Priority
Last Modified: 2010-05-01
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?
Question by:deltatuk
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

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

Enjoy your work,  P1
LVL 14

Expert Comment

ID: 8220981
You mean something like this ?

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

Accepted Solution

P1 earned 200 total points
ID: 8220983

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

Enjoy your work,  P1

Expert Comment

ID: 8221305
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


Author Comment

ID: 8221423
Worked perfectly. Thanks for your help.

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month12 days, 14 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question