Page 1 of 1

Shell Path Problems

Posted: Fri May 22, 2009 3:39 am
by bidgeeman
Hi.
Trying to launch a bat file with a shell command from an exe in a folder in windows.

The exe is located C:\Program Files\mp3tool
The bat file is located C:\Program Files\mp3tool\Library

get shell("C:\merge.bat") used to work when the exe and bat file were located in the C:\ directory but now I cannot get the bat file to lauch a all.

I've tried a number of combinations,backslashes but none I tried will execute the bat file.

set the hideConsoleWindows to true
get shell ("C:/Program Files/mp3tool/Library/merge.bat")

Any help would be greatly appreciated.


EDIT: I just tried to put the exe and .bat file together in a new directory, C:/Test, and it ran fine.....but the path C:/Program Files will not work? I don't know what's happening???


Thanks
Bidge

Posted: Fri May 22, 2009 6:59 am
by Janschenkel
When working with files inside Revolution, you need to use slashes as path separators; but when you're using a function like shell you ned to use the native path separator syntax.

Code: Select all

set the hideConsoleWindows to false  -- true 
get shell ("C:\Program Files\mp3tool\Library\merge.bat")
Until you're sure the shell command works, you're better off setting the hideConsoleWindows to false as you may receive a clue about why something isn't working.
Depending on the batch command processor (cmd.exe or command.com), you may have to put quotes around paths that contain spaces. So if changing the path separator wasn't enough, try this.

Code: Select all

set the hideConsoleWindows to false  -- true 
put quote & "C:\Program Files\mp3tool\Library\merge.bat" & quote into tCommand
get shell(tCommand)
Jan Schenkel.

Posted: Fri May 22, 2009 1:36 pm
by bidgeeman
Thanks for the response Janschenkel. Unfortunately none of those options worked either? I don't know what's happening? The bat file works fine in a drive directly in the C:/ directory but not in C:/Program Files?

Bidge

Posted: Fri May 22, 2009 8:34 pm
by paul_gr
Jan's script worked for me.
Might be some sort of permissions problem.
The Program Files directory is not as easy to use as it used to be :)
Using Vista (UAC turned on) I don't have any problems with calling a batch file in Program Files.
Are you using Vista or XP?

cheers
Paul

Posted: Sat May 23, 2009 1:03 am
by bidgeeman
Hi Paulgr.

Using XP Home.
Its strange. If I put the exe in a folder directly under the C:/ dir everything works fine? It's sounding like my fault so i'll try it once more just to make sure.

Cheers
Bidge

Posted: Sat May 23, 2009 1:12 am
by bidgeeman
YES!!! It worked.Thank you so much Janschenkel. The second script finally worked for me. I must have had a typo somewhere.

Many many thanks to you all again for the help.
Cheers
Bidge