I find problems with this all the time.. I have had to resort to the following ...

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 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.

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..

-----
Of all the things I've lost in my life, its my mind I miss the most.

In reply to Re: System substitution by AcidHawk
in thread System substitution by bitman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.