cgi invoked .bat script can't access network drives!

Discussion in 'Perl' started by Jonas, Jun 21, 2004.

  1. Jonas

    Jonas Guest

    Good day, I have a .bat script I'm invoking thru a cgi script (PERL)
    with (NT/IIS) on a internal network. The .bat script is having
    problems accessing network drives, it keeps saying "Invalid drive
    specification". I have tried to access the drives like this:
    \\servername\share\...... and like this: G:\.....

    When I change the cgi script to a regular perl script and invoke it
    from the command line it works fine...
    When I change the path to the local drive (C:) everything works well.

    Does anybody have any ideas of how to get around this and still
    keeping the .bat file?
    Below is an example of how my script/bat file is setup:

    ####Script
    #!/usr/bin/perl -w
    use strict;
    use CGI;
    my $q = new CGI();
    $|=1;
    print $q->header('text/html');
    print "Start<br>";
    my $path = 'batfile.bat';
    my $results = `$path`;
    print "$results<br>";
    print "done<br>\n";

    #batfile example line
    xcopy "C:\files\*.*" "\\servername\share\files" /E /y /I

    Thanks, Jonas
     
    Jonas, Jun 21, 2004
    #1
    1. Advertising

  2. Jonas

    Joe Smith Guest

    Jonas wrote:
    ... has a BAT file that works fine when he is logged into the PC
    as himself but does not work when invoked via the user-id that IIS
    uses while running the web server as a service.

    Clearly the user IUSR is not authorized to write anything in the
    destination directory. Fix that, and remember to post to
    the comp.lang.perl.misc newsgroup next time, not 'comp.lang.perl'.
    -Joe
     
    Joe Smith, Jun 22, 2004
    #2
    1. Advertising

  3. Jonas

    Jonas Guest

    Joe Smith <> wrote in message news:<vHTBc.87675$eu.80371@attbi_s02>...
    > Jonas wrote:
    > ... has a BAT file that works fine when he is logged into the PC
    > as himself but does not work when invoked via the user-id that IIS
    > uses while running the web server as a service.
    >
    > Clearly the user IUSR is not authorized to write anything in the
    > destination directory. Fix that, and remember to post to
    > the comp.lang.perl.misc newsgroup next time, not 'comp.lang.perl'.
    > -Joe


    Joe, thanks for your response. Unfortunately I'm not able to change
    IUSR's access. Do you have any other suggestions?
    Thanks, Jonas
     
    Jonas, Jun 22, 2004
    #3
  4. Jonas wrote:
    > Joe Smith <> wrote in message
    > news:<vHTBc.87675$eu.80371@attbi_s02>...
    >> Jonas wrote:
    >> ... has a BAT file that works fine when he is logged into the PC
    >> as himself but does not work when invoked via the user-id that IIS
    >> uses while running the web server as a service.
    >>
    >> Clearly the user IUSR is not authorized to write anything in the
    >> destination directory. Fix that, and remember to post to
    >> the comp.lang.perl.misc newsgroup next time, not 'comp.lang.perl'.

    >
    > Joe, thanks for your response. Unfortunately I'm not able to change
    > IUSR's access. Do you have any other suggestions?


    Change the UID that IIS uses to a userid that does have access.

    Honestly, what do you expect?

    jue
     
    Jürgen Exner, Jun 22, 2004
    #4
  5. Jonas

    Guest

    Joe Smith <> wrote in message news:<vHTBc.87675$eu.80371@attbi_s02>...

    [ snip stuff about user IDs and permssions wrt CGI scripts run from
    IIS ]

    > ...and remember to post to
    > the comp.lang.perl.misc newsgroup next time, not 'comp.lang.perl'.


    Why? This had nothing at all to do with Perl.

    It is, of course, true that one should not post to comp.lang.perl
    (because it doesn't exist (see FAQ)).

    However, general (language neutral) questions about programming for
    the CGI API or questions about IIS configuration should be posted to
    newsgroups that deal with those topics respectively.

    Such questions should not be posted to newsgroups that deal with the
    Perl programming language as they will be unwellcome there.

    To the OP: try to partition your problems. Did you seriously think
    that the fact that there was a Perl process between the IIS process
    and the .bat script would make the situation any different from having
    had a python script or having written a CGI script completely as a
    ..bat? If not then why did you think that a Perl newsgroup was the
    place to ask about this?
     
    , Jun 22, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Stratton

    .Net mapping Network Drives

    David Stratton, Jan 21, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    658
    Chris Taylor
    Jan 21, 2004
  2. =?Utf-8?B?UHJhZGVlcCBTdW5kYXJhbShNU0ZUKQ==?=

    Enumerate all the drives including Mapped network drives on a serv

    =?Utf-8?B?UHJhZGVlcCBTdW5kYXJhbShNU0ZUKQ==?=, Feb 25, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    1,056
    =?Utf-8?B?UHJhZGVlcCBTdW5kYXJhbShNU0ZUKQ==?=
    Feb 26, 2005
  3. =?Utf-8?B?TmVvIFRoZSBPbmU=?=

    Should JIT be invoked by NETWORK SERVICE account?

    =?Utf-8?B?TmVvIFRoZSBPbmU=?=, Sep 21, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    1,067
    =?Utf-8?B?TmVvIFRoZSBPbmU=?=
    Sep 21, 2006
  4. Replies:
    4
    Views:
    263
  5. Tom Salzmann
    Replies:
    3
    Views:
    285
Loading...

Share This Page