I find problems with this all the time.. I have had to resort to the following ...
I have tested this code and it does take the command line param from the .pl script and place it after the shortened path with the bat file.use win32; $path = "C:\\Test Path\\test file.bat"; $parameter = $ARGV[0]; unless ($bat_file = Win32::GetShortPathName($path)) { print "$bat_file - Path Problems in Setup for $path: $^E\n"); exit(); } $bat_file =~s /\\/\//g; print "$bat_file\n"; system("$bat_file $parameter");
I was only echoing a hello %1 in the bat file and from the command line running 214402.pl AcidHawk which resulted in the bat file echoing Hello AcidHawk..
Update: Hmm... let me relook at this question..
You can use the Win32::GetshortPathName for both your $ENV{TYPE} as well as your $new_debug_log. The code above can still apply though instead of using $ARGV[0] use your $new_debug_log var that you have got the short path name for..
-----In reply to Re: System substitution
by AcidHawk
in thread System substitution
by bitman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |