i get a syntax error with the following shell command
i know its just a comma or a quotes needed but i cant figure it out.Code:Shell Environ$("UserProfile") & "\myinfo.bat" Environ$("UserProfile") & "\outfile.txt",vbHide
Printable View
i get a syntax error with the following shell command
i know its just a comma or a quotes needed but i cant figure it out.Code:Shell Environ$("UserProfile") & "\myinfo.bat" Environ$("UserProfile") & "\outfile.txt",vbHide
You didn't concatenate the string at the begining of the second call to Environ.
im still missing it. what do i need to do?
...myinfo.bat" Environ$("Use...
Those are not connected, you are missing the string concatenation: &
...myinfo.bat " & Environ$("Use...
Shell Environ$("UserProfile") & "\myinfo.bat " & Environ$("UserProfile") & "\outfile.txt",vbHideQuote:
im still missing it. what do i need to do?
if the returned value from environQuote:
Environ$("UserProfile")
or the filename can contain space the path\filename must be enclosed in quotes
Shell """" & Environ$("UserProfile") & "\myinfo.bat"" """ & Environ$("UserProfile") & "\outfile.txt""",vbHide
I was hoping to point him towards solving it himself, but ok. :)
Using Chr(34) might be easier for him. I too sometimes get confused when the quotes pile up like that.
Code:Shell Chr(34) & Environ$("UserProfile") & "\myinfo.bat" & Chr(34) & " " & Chr(34) & Environ$("UserProfile") & "\outfile.txt" & Chr(34),vbHide