Okay, I even went out of my way and renamed some things so that I had spaces in my path but that didn't change my results. This type of stuff has changed between versions of Perl so perhaps that explains our different results. I was doing this testing using v5.6.0 ActivePerl build 616.
I suspect that Perl's 'if CreateProcess() fails, then just retry with CreateProcess("cmd.exe","/c ...",...)' logic is masking the real error here. I'd think that using an indirect object with system would disable that logic, but I haven't checked that.
In any case, you can always do:
and I'm pretty sure that will fix errors due to spaces in file names.use Win32; $vss= Win32::GetShortPathName( "D:\\Program Files\\" . "Microsoft Visual Studio\\Common\\VSS\\win32\\ss.exe");
You also might want to try Win32::Process to see if you can reproduce why Perl thinks CreateProcess() is failing.
- tye (but my friends call me "Tye")In reply to (tye)Re2: 'system' not working!
by tye
in thread 'system' not working!
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |