Output:require Win32; Win32->import; my $patharg = $ARGV[0]; print "ARGV: [$patharg]\n"; $path = "\"" . Win32::GetShortPathName($patharg) . "\""; print "patharg: [$patharg]\n"; print "path: [$path]\n"; my $cmd = "$path\\disc"; print "Issuing cmd: [$cmd]\n"; my $op = `$cmd`; my $ret = $?; print "ret: [$ret], op: [$op]\n"; $cmd = "$path\\disc -v"; print "Issuing cmd: [$cmd]\n"; $op = `$cmd`; $ret = $?; print "ret: [$ret], op: [$op]\n" ####################
If I maually run the command without any args, it runs fine:C:\Users\Administrator.ZEN>perl test.pl "C:\Program Files\GFN%$^#\CLI\ +bin" ARGV: [C:\Program Files\GFN%$^#\CLI\bin] patharg: [C:\Program Files\GFN%$^#\CLI\bin] path: ["C:\PROGRA~1\GFN%$^#\CLI\bin"] Issuing cmd: ["C:\PROGRA~1\GFN%$^#\CLI\bin"\disc] The system cannot find the path specified. ret: [256], op: [] Issuing cmd: ["C:\PROGRA~1\GFN%$^#\CLI\bin"\disc -v] ret: [0], op: [ Discovery Version: 7.2.10.0 <snip> ]
I have to qualify the script with paths containing such special characters.C:\Users\Administrator.ZEN>"C:\Program Files\GFN%$^#\CLI\bin"\disc Discovery Version: 7.2.10.0
In reply to Re: perl windows backtick problem
by Anonymous Monk
in thread perl windows backtick problem
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |