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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to map a drive letter at boot, before login

Status
Not open for further replies.

kmcferrin

MIS
Jul 14, 2003
2,938
US
OK, so I have this customer that has a process that requires a lot of disk space. At the moment adding disk space to the array isn't an option. Maybe next quarter it will be, but I'm trying to implement a bandaid. In the meantime, they have space available on a Linux box that we created a share for with Samba.

I can map to the share with net use or via the Windows GUI without any problems. However, the customer has a service that runs at startup that needs to be able to access this space. This service cannot use UNC paths, it must be mapped to a drive letter. If I map the drive as a user, and check reconnect at logon, the drive is only available when I am logged in. I put a NET USE command in the registry under HKLM\Software\Microsoft\Windows\CurrentVersion\Run, and that seems to work a little. Every user who logs in has access to the mapped drive, but it doesn't look like the drive is mapped if nobody is logged in. The service runs on bootup, and so it still can't see the drive and fails.

Does anyone know of a way for the system to have access to the mapped drive without having a user logged on?
 
Here is the script i used to achieve a similar setup.

Code:
Set WSHNetwork = CreateObject("WScript.Network")


Set objNetwork = Wscript.CreateObject("WScript.Network")
objNetwork.MapNetworkDrive "M:", "\\server\share"


set WSHNetwork = Nothing

wscript.quit
 
I understand mapping drives with VBScript, but I am not familiar with the term "station startup script". Is this something set in the registry or the local machine policy? Again, this drive needs to be mapped when the system is started, before (and regardless of whether) someone logs on. And it will have to be started before one of the installed services starts.
 
Are you using Active Directory?

If you are then you will find the policy located at Computer Configuration - Windows Settings - Scripts

if not you can use local policy you will find it in the same location.

I use this on certain PC's to map a drive that always needs to be there regardless of who logs on, it is mapped when the PC boots when group policy is applied. I can't tell you if this will map before your service starts you will just have to try or try to delay the service starting.
 
Hmm...it's still not working. Now they're telling me that they think that it can use UNC paths, so I guess we'll test it that way and hope for the best.

Thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top