Help with Shell(Application.exe)
Posted: Sat Aug 11, 2012 8:32 pm
Hey Guys, whats up... I am a beginner.
I've been playing around with LiveCode for 2 months now.
I am getting a bit annoyed with the errors that i sometimes get not because of the code but sometimes because of the LiveCode program itself. Sometimes i run into problems that basically causes me to dissect every little piece of text and bring it back to the most basic way just to see if LiveCode even excepts such executions. For some reason, which i have not gotten in depth for, yet, restarting LiveCode solves some errors. It may have to do with certain variables or parameters getting stuck in memory somewhere.
...I really dont know. I'm a beginner like i said.
Anyways, Ive been trying to figure this little issue out for a while, I feel like i've re-worked the code a million times with many different settings that i may be screwing stuff up and permanently setting some function variables which i have yet to figure out how to undo.
My small problem is this...
I am making a little transferring application. Using put url.
The information i am sending is first generated by a windows executable.
We all know that the drive letter on USB drives change all the time.
If I use windows commands to discover what my path is i can simply use 'cd', which will give me somethine like F:\folder\folder or
C:\somefolder\folder\programfolder\ ...from that ouput i know that my command/script is running from F or C.
When i try to run an executable in LiveCode, I am doing this,
set the shellCommand to "C:\Windows\System32\cmd.exe"
do Shell("Application.exe")
But i get error at line # (do: error in source expression) near "'Application.exe' is not recognized as an internal or external command", char 1
If i change that to "C:\Application.exe" - it will run
If i remove the set the shellCommand function or put empty into it,
i get a error that says error at line n/a (shell: cant run shell command) near " /C C:\Application.exe"
Why does LiveCode run commands with "/C" and how can i remove that - or - how can i discover in what drive my application is running from.
I've been playing around with LiveCode for 2 months now.
I am getting a bit annoyed with the errors that i sometimes get not because of the code but sometimes because of the LiveCode program itself. Sometimes i run into problems that basically causes me to dissect every little piece of text and bring it back to the most basic way just to see if LiveCode even excepts such executions. For some reason, which i have not gotten in depth for, yet, restarting LiveCode solves some errors. It may have to do with certain variables or parameters getting stuck in memory somewhere.
...I really dont know. I'm a beginner like i said.
Anyways, Ive been trying to figure this little issue out for a while, I feel like i've re-worked the code a million times with many different settings that i may be screwing stuff up and permanently setting some function variables which i have yet to figure out how to undo.
My small problem is this...
I am making a little transferring application. Using put url.
The information i am sending is first generated by a windows executable.
We all know that the drive letter on USB drives change all the time.
If I use windows commands to discover what my path is i can simply use 'cd', which will give me somethine like F:\folder\folder or
C:\somefolder\folder\programfolder\ ...from that ouput i know that my command/script is running from F or C.
When i try to run an executable in LiveCode, I am doing this,
set the shellCommand to "C:\Windows\System32\cmd.exe"
do Shell("Application.exe")
But i get error at line # (do: error in source expression) near "'Application.exe' is not recognized as an internal or external command", char 1
If i change that to "C:\Application.exe" - it will run
If i remove the set the shellCommand function or put empty into it,
i get a error that says error at line n/a (shell: cant run shell command) near " /C C:\Application.exe"
Why does LiveCode run commands with "/C" and how can i remove that - or - how can i discover in what drive my application is running from.