Net Use eror during login script

J

Jordan

I have a pretty basic login script that clears old mapped drives, syncs the
time, then maps the current drives. Most days there is no problem with the
scripts, but I have just a few computers that at least once a week have a
problem mapping to the drives. The get these errors:

=====
"There are open files and/or incomplete directory searches pending on the
connection to O:"
"There are open files and/or incomplete directory searches pending on the
connection to P:"
"There are open files and/or incomplete directory searches pending on the
connection to Q:"
=====

This is the login script

=====

Net Use * /Delete /Yes
Net Time %LOGONSERVER% /set /y
Net Use O: "\\Files\O Drive" /YES
Net Use P: "\\Files\P Drive" /YES
Net Use Q: "\\Files\Q Drive" /YES
======

What I can't figure out is why these few computer have the problem, but no
one else does. If I run the login script manually
(\\domaincontroller\netlogon\logon.bat) after they have logged in for a
minute or two, the script runs fine even though it just failed at logon.
 
P

Pegasus \(MVP\)

Jordan said:
I have a pretty basic login script that clears old mapped drives, syncs the
time, then maps the current drives. Most days there is no problem with the
scripts, but I have just a few computers that at least once a week have a
problem mapping to the drives. The get these errors:

=====
"There are open files and/or incomplete directory searches pending on the
connection to O:"
"There are open files and/or incomplete directory searches pending on the
connection to P:"
"There are open files and/or incomplete directory searches pending on the
connection to Q:"
=====

This is the login script

=====

Net Use * /Delete /Yes
Net Time %LOGONSERVER% /set /y
Net Use O: "\\Files\O Drive" /YES
Net Use P: "\\Files\P Drive" /YES
Net Use Q: "\\Files\Q Drive" /YES
======

What I can't figure out is why these few computer have the problem, but no
one else does. If I run the login script manually
(\\domaincontroller\netlogon\logon.bat) after they have logged in for a
minute or two, the script runs fine even though it just failed at logon.

It appears that you got Windows to remember past connections.
There is no point in doing this when you map your drives with a
logon script. Change your code as follows:

net use /persistent:no
Net Use * /Delete /Yes
Net Time %LOGONSERVER% /set /y
Net Use O: "\\Files\O Drive" /YES
Net Use P: "\\Files\P Drive" /YES
Net Use Q: "\\Files\Q Drive" /YES

After a week or two you can delete this line:
Net Use * /Delete /Yes
because you won't have any remembered connections,
hence there will be nothing to delete.
 
J

Jordan

I actually do need the connections to be remembered because all the laptop
users use Offline Files on these drives. If I did "/Persistent:No" they
would have to go through My Network Places to get to their files and none of
them can grasp the concept of UNCs.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top