
seamanrob2004
Novice

Apr 16, 2007, 3:45 PM
Post #1 of 1
(5097 views)
|
Network Drives, Shared Drives, Net Use
|
Can't Post
|
|
Ive attempted to write this three times now in this forum and every time I loose it... so heres the short short version. 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! CLS PRINT "PLEASE WAIT - SYSTEM STARTING" PRINT PRINT "STARTING TERMINAL1 SERVICES" SLEEP (60) PRINT "RECONNECTING TERMINAL 1 PRINTER" PRINT PRINT "PLEASE WAIT....." SHELL "NET USE LPT4 \\COUNTER1\C1" PRINT PRINT "PLEASE WAIT FOR THE NETWORK TO CONNECT" PRINT PRINT "RECONNECTING KITCHEN PRINTER" SLEEP (1) SHELL "NET USE LPT5 \\COUNTER1\K1" PRINT PRINT "RECONNECTING TO DRIVE W: (SHARED FILES)" SHELL "NET USE w: \\counter1\cdrive" SLEEP (1) PRINT PRINT "*** ALL PRINTERS RECONNECTED ***" PRINT " A summary is listed below " PRINT SHELL "NET USE" PRINT PRINT "NOW STARTING INTERNET EXPLORER" SHELL "CD\" SHELL "CD PROGRA~1" SHELL "CD INTERN~1" SHELL "IEXPLORE" PRINT PRINT "SHUTTING DOWN.... PLEASE WAIT" PRINT PRINT "UNLINKING NETWORK CONNECTIONS" SHELL "NET USE LPT4 /DELETE" SHELL "NET USE LPT5 /DELETE" SHELL "NET USE W: /DELETE" PRINT PRINT "COMPLETED... NOW SHUTTING DOWN" SHELL "SHUTDOWN -s" END ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ veritas vos liberabit ~ The truth shall set you free
|