Question : Need help with Drive Mapping while Logged Off

I am using Windows Script Host on Windows 2000 (vbscript) to map and unmap drives while the user is logged off.  There are several overnight jobs that I need to run on the system (such as backup) and I need the network drives to be mapped for the jobs' sake.  

However, when the user logs off the system, all the mapped drives that the user uses are disconnected.  So I need to re-map the drives WHILE the user is logged off.  I can do that using a vbscript (WSH) and schedule the script to run on command line (cscript).  The drives seem to map okay, but it is the UNmapping of the drives that is where the problem comes in.  Some users have different drives mapped and they use different letters for each drive, so I want the scheduled job to unmap the drives so that the user can have a clean slate for logging back in.  

When I run a scheduled task of unmapping the drives, and I log back in, the "unmapped" drives are still there.  But I cannot open them and view its contents, although the drive letters are occupied.  Looking at the drives in the My Computer folder, they all have a red "X" on the drive icons, and sometimes they don't explicitly name the mapped path as it should - instead it says "Network Drive" (under the NAME column, not just the Type).  I tried disconnecting them (Tools --> Disconnect network drive) but that doesn't work.  I've had to reboot a couple times to clean out the mess.

When I run the vbscript and the job themselves WHILE logged in, everything seems to work fine.  But when I schedule it and it runs while being logged out, thats where it gets messy.

Does anyone have expereince with scheduled drive mapping while logged out?  Help?

Thanks!

Answer : Need help with Drive Mapping while Logged Off

Are you using net use?

If so, add the switch /persistent:no

Random Solutions  
 
programming4us programming4us