473,394 Members | 1,567 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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

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
Jul 19 '05 #1
4 3952
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
Jul 19 '05 #2
Joe Smith <Jo*******@inwap.com> 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
Jul 19 '05 #3
Jonas wrote:
Joe Smith <Jo*******@inwap.com> 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
Jul 19 '05 #4
Joe Smith <Jo*******@inwap.com> 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?
Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: moonriver | last post by:
I write a program accessing files in network drive o:. It is doable as a standalone application. However, if it is running under windows service, the following exception will appear: 13/07/2004...
2
by: Jim Richards | last post by:
I have been told by a local PC club technician that 98SE cannot read NTFS drives in a network. Is this true? TIA, Jim.
1
by: Christian-Josef Schrattenthaler | last post by:
Hi! I have a batch-file (*.bat) which logon the client to our server, including printer and drive mappings. Now I want to replace the batch-file with a script for the windows scripting host,...
4
by: cvopicka | last post by:
i have found many refrences to access being slow over a netowrk but my boss and i just found this and i was hoping to get some help. on the local machine we have the Access 2000 format database...
1
by: Mortel | last post by:
Hi, What I find in this product ? I want to buy this tool but I'm afraid that it's simple tool to do good application. I know that I can read about that on the internet but I want to hear what...
3
by: Daniel Xiao | last post by:
I write a program accessing files in network drive o:. It is doable as a standalone application. However, if it is running under windows service, the following exception will appear: 13/07/2004...
5
by: Mike McIntyre [MVP] | last post by:
I am working on an issue where and ASP.NET web application on one computer (A) needs to access files on a network mapped drive (B). This application uses as DSN on (A) that maps a proprietory...
2
by: Gregor Horvath | last post by:
Hi, I have a testservice.py (see below). I installed the Windows-Service successfully. (via commandlineoption install) The problem is that it runs only when it is in c:\windows\system32 or in...
25
by: p byers | last post by:
Good Morning Folks I have a LAN Among the several connections to it are the following four devices: A MAXSTOR network Storage Device A PC running Microsoft Windows 2000 Server 5.0.2195 (SP4) A...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.