Link to home
Start Free TrialLog in
Avatar of HilltownHealthCenter
HilltownHealthCenter

asked on

Hot to batch script "net share <fn> /delete" to skip yes/no query

I want to unshare a network drive using "net share <fn> /delete", but if files are in use, the utility queries the user "others are using this share, do you really want to..." etc. I want to script an unconditional unshare, to run in a batch file. I tried /y after the command, but this did not do it.
ASKER CERTIFIED SOLUTION
Avatar of Andrej Pirman
Andrej Pirman
Flag of Slovenia image

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
Avatar of HilltownHealthCenter
HilltownHealthCenter

ASKER

Yes, it worked for me. I don't know why if failed on my first experiment.