Search This Blog

Sunday, November 06, 2011

Batch File: Force delete of share

I have recently found that there is a way to force delete a share. It was causing me grief in batch files as it was moaning there was an file in use and would want user input (Y/N).

You can actually use /Y in the command to force the yes, this is not list in the command help.

net share %Sharename% \\%COMPUTERNAME% /Y /DELETE

Someone else experienced this issue and has kindly forwarded this reference links, so I include them here. Thanks.

The MS docs that don't tell us:
Expert's Exchange had the answer in 2008 but hides it at the bottom of the page:
also just answered it on SuperUser:



  1. Thank you! It's work!

    net share %Sharename% \\%COMPUTERNAME% /Y /DELETE

  2. Now, the users can gain the required assistance to their tricky circumstances through Gmail customer care phone number. It is found that people are constantly complaining about many problems arising while using Gmail accounts.
    read more