Running version 5.005_03 under Windows 2000.
I am attempting to launch wordpad.exe, giving its full path, using "system". The code (file "wp.pl") looks like this:
I run it from a cmd.exe window like so:
<perl's path>\perl.exe -w wp.pl
Oddly, the wordpad window actually does come up, but with an error dialog titled "Microsoft Visual C++ Runtime Library", stating:
Runtime Error!
Program: C:\Program Files\Windows NT\Accessories\wordpad.exe
abormal program termination
I have two workarounds so far:
1. If I add wordpad.exe's location to $ENV{'PATH'}, and reduce @systemCmd to just ("wordpad.exe", ""), it works.
2. If I copy wordpad.exe to a folder whose path has no spaces, and use that path in @systemCmd instead, it works.
Things I have tried (that haven't helped):
A. Using forward slashes instead of double backslashes;
B. Using single quotes instead of double quotes;
C. Using \x20 instead of spaces;
D. Using %20 instead of spaces (?? beats me - saw it in thread219-740789 for a similar problem - wordpad wouldn't even spawn in this case).
I can live with one of the workarounds, I suppose, but I'd prefer to use the full path as-is. Suggestions?
Thanks,
GD
I am attempting to launch wordpad.exe, giving its full path, using "system". The code (file "wp.pl") looks like this:
Code:
use strict;
my @systemCmd =
("C:\\Program Files\\Windows NT\\Accessories\\wordpad.exe", "");
system (@systemCmd);
I run it from a cmd.exe window like so:
<perl's path>\perl.exe -w wp.pl
Oddly, the wordpad window actually does come up, but with an error dialog titled "Microsoft Visual C++ Runtime Library", stating:
Runtime Error!
Program: C:\Program Files\Windows NT\Accessories\wordpad.exe
abormal program termination
I have two workarounds so far:
1. If I add wordpad.exe's location to $ENV{'PATH'}, and reduce @systemCmd to just ("wordpad.exe", ""), it works.
2. If I copy wordpad.exe to a folder whose path has no spaces, and use that path in @systemCmd instead, it works.
Things I have tried (that haven't helped):
A. Using forward slashes instead of double backslashes;
B. Using single quotes instead of double quotes;
C. Using \x20 instead of spaces;
D. Using %20 instead of spaces (?? beats me - saw it in thread219-740789 for a similar problem - wordpad wouldn't even spawn in this case).
I can live with one of the workarounds, I suppose, but I'd prefer to use the full path as-is. Suggestions?
Thanks,
GD