Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

chdir to UNC path

Status
Not open for further replies.

Milleniumlegend

IS-IT--Management
Dec 16, 2003
135
Could you please let me know how to chdir to UNC path on windows server.

I have a perl script that I would like to run on a remote server. I would like to chdir to ////server-name//directory share.

If I use the above convention the windows command line would complain as windows command line does not support UNC path.

I am using ccperl.exe so would like to know if there are any tricks to achieve this.

Many thanks
 
As a workaround in the past I have cheated by calling a system NET USE command within some scripts to map the drive then execute. Once complete I would drop the mapped drive ... not sure if that would work for you ... not sure if you want it to ...


-Chris Larivee
 
I have tried the net use and tried using persistent connection to do such a work around but that would not work all the time. The connection seems to drop down in between and in some instances we have about 3 requests for the script in a second which causes the script to do funny things.
Apart from that we will need to use a generic logon for the net use to work as the script that I am running is run by the system.

I would like to see if there are any other alternatives to do this. Or if I can use the script from the local server and call this scripts that would be good as well.

 
Short of having a mapped drive. I dont think there is any good solution. I encountered a similar problem a while ago.
I cheated by converting it into a CGI script and got people to run it from a secured web page.
I played with a few 'work arounds' but didnt have the time to perfect them.
The cgi script was writen to parse some files, extract values and dump them into a csv.
After the user clicks the action button, the script does its magic and creates the output file in the users home directory on the server.
 
I guess the perfect way is to create a service on windows box and then give the service administrative rights to the server. Run the scripts as a service and it will do the right stuff.

I am in the process of creating a service and will let you know if I have any luck.

Many thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top