• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3514
  • Last Modified:

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.
1 Solution
Andrej PirmanCommented:
NET SHARE sharename /D /y
This actually works.
HilltownHealthCenterAuthor Commented:
Yes, it worked for me. I don't know why if failed on my first experiment.

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now