Link to home
Start Free TrialLog in
Avatar of jdff
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

Avatar of luv2smile
luv2smile

Not sure about your method, but I use this method to delete mappings and have had no issues:

http://www.computerperformance.co.uk/Logon/Logon_Remove.htm
@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
Avatar of jdff

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
SOLUTION
Avatar of paul_knapp
paul_knapp

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial