1

I have several batch programs that run from the windows scheduler. When there is no user logged into the server after a restart (at the login screen,) the first batch program to run connects to the network share fine, but then the next batch that runs can not access the drive.

net use responds with this:

System error 85 has occurred. 

The local device name is already in use. 

this is normal since the drive is usually already mapped.

the script returns with this error when it tries to access the mapped drive

Logon failure: unknown user name or bad password.

When I log in, the network drive appears to be mapped in My computer, but it is unaccessible. with the error "local device name is already in use"

If I disconnect the drive it come back and then says the Logon failure error.

1 Answers1

3

Net use isn't intended to work w/out a user logon so mapping a drive on boot w/out an actual logon isn't supported. http://support.microsoft.com/kb/180362

More General Info: Mapped drives require authentication to connect, which implies and normally requires a user to be logged on. You can force authentication or provide specific authentication credentials with Net Use....Net use X: \Server\ShareName /User:%username% %password%.

Once authenticated during a logon session all other connections to the same server must use the same credentials but w/out an actual logon all bets are off. Better option is to use a UNC path instead of a mapped drive for whatever resource you need to access.

Ed Fries
  • 1,619
  • 2
  • 12
  • 14