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

J

Jonas

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
 
J

Joe Smith

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
 
J

Jonas

Joe Smith said:
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
 
J

Jürgen Exner

Jonas said:
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
 
N

nobull

[ 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?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top