Hi,
I’m working on a project in which code will call another exe file from the same file path as the main file. I figure out I need to use some Shell script to make it happen. However, I met a problem is the Shell seems can only run one line of script, but I need multiple lines. I’m in Windows platform.
Here is the script I hope to run in shell.
“cd /d c:\users\xyz\documents\project1”
as you can see, under folder c:\users\xyz\documents\project1\ there will be a exe file named “command.exe”
“command.exe /?”
command.exe /? will show some help info about this command. I use it here just as a demo, in real code case, I will pass the correct parameters here instead of “/?”
So, in my xojo code, I tried
Dim sh As New Shell
sh.Execute("cd /d c:\\users\\xyz\\documents\\project1\\command.exe /?")
msgbox sh.result
sh.close
the code above doesn’t give me the result as I expeceted.
Then I tried
Dim sh As New Shell
sh.Execute("cd /d c:\\users\\xyz\\documents\\project1\")
sh.WriteLine("command.exe /?")
msgbox sh.result
sh.close
This won’t work either.
What should I do to make this work, should I use different script? I try those steps only because I did the same steps in Windows cmd box.
Thanks in advance.