Apr 16, 2007, 3:45 PM
Post #1 of 1
Ive attempted to write this three times now in this forum and every time I loose it... so heres the short short version.
Network Drives, Shared Drives, Net Use
I had problems using a mapped drive with my perl scripts.
It turns out I had my webserver set to run as a service, which unfortunately runs under a different permission set to a regular joe user.
So after setting my webserver to not run as a service, but to start when the user logged on, i overcame the problem.
The mapped drive was fine btw, under windows.... just perl didnt like it - and that was the reason why.
I did go into more depth before, but after three attempts I cant be bothered now.
Just hope this helps someone.
And for anyone interested in using NET USE: (mapping drives, printers etc) this is how I do it......... there are various ways..........
Below is a BASIC .BAS file, which I compiled into an exe file and run when the user logs on. I used QBasic Compiler to do this (you can sometimes find it online for download although Microsoft arent too keen on you downloading it)
Basically, when the program loads, it waits 60 seconds so that the wireless card can connect to the network.
It then connects 2 printers and a shared network drive (w:) to the computer.
It then opens Intenet Explorer which starts all my scripts running (I have my scripts set as the homepage so IE loads them direct).
The program then waits indefiniately until IE is closed, and then unlinks all the shared facilities and shuts the pc down using shutdown.exe
In my case i have to unmap the drives etc because otherwise on logon the pc prompts me to reconnect drives etc which is a pain in the backside....
HERES THE CODE!
PRINT "PLEASE WAIT - SYSTEM STARTING"
PRINT "STARTING TERMINAL1 SERVICES"
PRINT "RECONNECTING TERMINAL 1 PRINTER"
PRINT "PLEASE WAIT....."
SHELL "NET USE LPT4 \\COUNTER1\C1"
PRINT "PLEASE WAIT FOR THE NETWORK TO CONNECT"
PRINT "RECONNECTING KITCHEN PRINTER"
SHELL "NET USE LPT5 \\COUNTER1\K1"
PRINT "RECONNECTING TO DRIVE W: (SHARED FILES)"
SHELL "NET USE w: \\counter1\cdrive"
PRINT "*** ALL PRINTERS RECONNECTED ***"
PRINT " A summary is listed below "
SHELL "NET USE"
PRINT "NOW STARTING INTERNET EXPLORER"
SHELL "CD PROGRA~1"
SHELL "CD INTERN~1"
PRINT "SHUTTING DOWN.... PLEASE WAIT"
PRINT "UNLINKING NETWORK CONNECTIONS"
SHELL "NET USE LPT4 /DELETE"
SHELL "NET USE LPT5 /DELETE"
SHELL "NET USE W: /DELETE"
PRINT "COMPLETED... NOW SHUTTING DOWN"
SHELL "SHUTDOWN -s"
veritas vos liberabit ~ The truth shall set you free