Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing a String's Value using the Shell Command

Status
Not open for further replies.

solidjp

Programmer
Jul 16, 2002
29
US
I am using the shell command to pass a variable to another vb program like this:

Shell "C:\Folder\App.exe sName"

sName holds a value like "Bob". But when I call the second app with sName attached to the end of it, the Command only sees sName as sName and not the value "Bob" that is assigned to it. So how do I send a string's value to the shelled app?

Thanks...
 
Instead of:

Shell "C:\Folder\App.exe sName"

Try using:

Shell "C:\Folder\App.exe " & sName

I think the sName is being treated as a literal because it is within your quotes.

Hope this helps
 
Thanks again TomKane and I am an idiot. I can't believe I've had that big of a brain fart for the past 4 days to not be able to figure that out. Anyway, thanks.
 
Not sure but I think it should be like this

Shell("C:\Folder\" & App.exe & " " & sName)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top