jdff
asked on
Forcing MAP drive to be deleted. URGENT
I'm running a map drive disconnection using dos command:
NET USE z: /delete
and sometimes it says:
There are open files and/or incomplete directory searches pending on connection to z:
Is it ok to continue disconnectind and force them closed? Y:N
How can I force that automaticley to Y, and not having that message to prompt me for Y or N?
Thanks
jdff
NET USE z: /delete
and sometimes it says:
There are open files and/or incomplete directory searches pending on connection to z:
Is it ok to continue disconnectind and force them closed? Y:N
How can I force that automaticley to Y, and not having that message to prompt me for Y or N?
Thanks
jdff
@echo off
If %OS% == Windows_NT GOTO WINNT
Echo The batch did not detect Windows NT, using Win9x
GOTO WIN9X
:WINNT
net use q: \\server\sharename /persistent:no
GOTO OUT
:WIN9X
net use q: \\server\sharename
GOTO OUT
:OUT
Above is a copy of a login script i use. This script checks the OS & runs the appropriate net use command. The key point here is for Windows 2000 & above is the /persistent:no switch. This stops these OS's from 'keeping' the mapped share. I don't know how u map drives at your location but i use login scripts. I don't allow users to map drives themselves. By using scripts u can change mapping without having to 'visit' each PC. Let me know
If %OS% == Windows_NT GOTO WINNT
Echo The batch did not detect Windows NT, using Win9x
GOTO WIN9X
:WINNT
net use q: \\server\sharename /persistent:no
GOTO OUT
:WIN9X
net use q: \\server\sharename
GOTO OUT
:OUT
Above is a copy of a login script i use. This script checks the OS & runs the appropriate net use command. The key point here is for Windows 2000 & above is the /persistent:no switch. This stops these OS's from 'keeping' the mapped share. I don't know how u map drives at your location but i use login scripts. I don't allow users to map drives themselves. By using scripts u can change mapping without having to 'visit' each PC. Let me know
ASKER
I'm using the same script method but I first delete the map and then recreat them but the problem seams to happen on the deletion. It ask me to force the deletion.
Ideas?
Thanks
jdff
Ideas?
Thanks
jdff
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www.computerperformance.co.uk/Logon/Logon_Remove.htm