Silently unshare a folder using Batch File

Telson Alva picture Telson Alva · Jan 18, 2012 · Viewed 6.9k times · Source

share and re-share a folder. I got the re-sharing part where i am stuck at is the un-sharing.

I use this code

NET SHARE d:\foldername /delete

Which deletes the share but if there are people accessing the folder there is prompt to continue, now i want this batch file to run silently without any prompts. Any thoughts ?

Answer

Telson Alva picture Telson Alva · Jan 18, 2012

This is the easier one i figured :)

NET SHARE d:\foldername /Y /delete