with a little help from my friends here and abroad:
@echo off rem Have echo follow the ECHO environment variable. Used for debugging +. if not {%ECHO%} == {} echo %ECHO% rem Make sure this is Windows NT. if not {%OS%} == {Windows_NT} goto :NOT_NT rem Set path for Windows commands. set WINEXE="%windir%\system32" rem Save the current environment and directory. setlocal pushd . if defined PERL goto :RUNPERL if not defined HOME ( for /f "tokens=*" %%i in ('cd') do set home=%%i ) if not defined HOME ( set HOME=%home:\tools\script=% ) if not exist "%HOME%\World" ( echo ERROR: Cannot determine HOME ^(please set it manually^) goto :DONE ) set OLDHOME=%HOME% if exist "%OLDHOME%\bin\Windows2000" set OLDARCH=Windows2000 if exist "%OLDHOME%\bin\WinNT4.0" set OLDARCH=WinNT4.0 set ARCH=%OLDARCH% set BIN=%HOME%\bin\%ARCH% if not exist "%BIN%" ( echo ERROR: BIN not found ^(BIN^) goto :DONE ) set LD_LIBRARY_PATH=%HOME%\lib\%ARCH% set PLAT=%ARCH% set PERL=%HOME%\tools\bin\%PLAT%\perl if not exist "%PERL%.exe" ( echo ERROR: perl not found ^(%PERL%.exe^) goto :DONE ) for /f "tokens=*" %%i in ('hostname') do set HOSTNAME=%%i :RUNPERL rem echo running PERL rem CMD /c %PERL%.exe %0 rem goto :DONE if exist "%HOME%\tools\script\%1.pl" ( call "%PERL%.exe" "%HOME%\tools\script\%1.pl" %2 ) else ( echo ERROR: %HOME%\tools\script\%1.pl doesn't exist ) goto :DONE :DONE popd & endlocal goto :EOF :NOT_NT rem ////////////////////////////////////////////////////////////////// +/////// rem This is not Windows NT. rem This procedure must fall through to the end of the file, for compa +tibility. echo This script requires Windows NT. rem ////////////////////////////////////////////////////////////////// +///////

We speak the way we breathe. --Fugazi


In reply to (jptxs)Re: win32 perl script when you don't know where perl is - my solution by jptxs
in thread win32 perl script when you don't know where perl is by jptxs

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.