in reply to How do I tell perl to excute a windows from a specif folder
As a few others have pointed out, the issue appears to be that you need quotes due to a space in the file path.
One suggestion that I would have for you is to store your external command in a variable and then test your script by having it print out the contents of that variable. That helps you verify that you have constructed your command correctly.
When you do that, check to make sure that characters like '\' are being interpolated correctly by Perl. If that's not happening, then you didn't construct your string correctly. Also, you can manually type the printed out contents of the command variable to see if you can get it run. If both of those "tests" pass, then you can modify your code to actually run the command.
In this case, I believe that if you opened a command prompt and ran 'cd c:\' and then tried running the command as you have it in your code, you would hit an error messages complaining about not finding 'C:\Program'. At that point, you probably would have realized that you needed to use quotes due to the space in the file path.
Sometimes I get in a hurry and don't do this myself. When I do skip this step and something isn't going right, this is always the first thing I do to debug the issue. In other words, my first debug step is to verify that my script is really making the command call that I think that it is.
Just thought I'd pass on this tip in case others might find it useful. It's helped me out numerous times.
|
|---|