http://www.perlmonks.org?node_id=554106

rhymejerky has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I have a perl script that call a vbs file via system ( ) on Win2K3 server. If I run it within the DOS prompt, everything executed correctly and the system ( ) return a "0". However, if I put the same script on IIS server and execute it through a browser, the return code is 65280. Dividing that number with 256 gets 255, and that suggest something is not right with the system call. Any suggestion on where to look? Thanks in advance Rhyme

Replies are listed 'Best First'.
Re: 65280 returned on system ( )
by chargrill (Parson) on Jun 07, 2006 at 18:27 UTC

    I'd suggest making sure you call your vbs file via a fully qualified path - OR the user account your webserver runs as doesn't have permission to execute the file.



    --chargrill
    $,=42;for(34,0,-3,9,-11,11,-17,7,-5){$*.=pack'c'=>$,+=$_}for(reverse s +plit//=>$* ){$%++?$ %%2?push@C,$_,$":push@c,$_,$":(push@C,$_,$")&&push@c,$"}$C[$# +C]=$/;($#C >$#c)?($ c=\@C)&&($ C=\@c):($ c=\@c)&&($C=\@C);$%=$|;for(@$c){print$_^ +$$C[$%++]}
      I put the statement if (-e "file.vbs") in the script to check for the file existence and the script didn't complain about not finding it. I even tried to call the vbs directly from a web browser (http://localhost/file.vbs) and the browser prompt me to open or save that file, so I think it is finding the vbs file.

        Being able to see the file is not the same as having permission to be able to execute it, or to call all the system APIs that it calls.

        To verify if this is a permissions problem, log onto the machine as the IIS user id (usually IUSR_<servername>), and then try running the vbs script from the command line.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.
        That doesn't mean that IWAM_YOUR-COMPUTER-GOES-HERE can execute the vbs. Check 'script' permission in IIS manager.