Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > cgi invoked .bat script can't access network drives!

Reply
Thread Tools

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

 
 
Jonas
Guest
Posts: n/a
 
      06-21-2004
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
 
Reply With Quote
 
 
 
 
Joe Smith
Guest
Posts: n/a
 
      06-22-2004
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
 
Reply With Quote
 
 
 
 
Jonas
Guest
Posts: n/a
 
      06-22-2004
Joe Smith <(E-Mail Removed)> 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
 
Reply With Quote
 
Jürgen Exner
Guest
Posts: n/a
 
      06-22-2004
Jonas wrote:
> Joe Smith <(E-Mail Removed)> 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


 
Reply With Quote
 
nobull@mail.com
Guest
Posts: n/a
 
      06-22-2004
Joe Smith <(E-Mail Removed)> 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?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IOError - cannot create file (linux daemon-invoked script) cassiope Python 16 01-06-2010 04:29 PM
Getting return code for a Python script invoked from a Linux shellscript volcano Python 4 09-24-2009 05:04 AM
Determining from which web page a cgi script is invoked? davidgould@davidgould.com Python 4 03-11-2009 03:08 AM
what's wrong calling a Perl/CGI script in Perl/CGI script under Tomcat server? kath Perl Misc 4 04-09-2007 09:21 PM
Get Invoked Script Location in Perl fiorentico@gmail.com Perl Misc 2 07-11-2006 10:34 PM



Advertisments