I'm attempting, using NAnt, to disconnect a share (in order to redirect it somewhere else) but my attempt fails:
[exec] Starting 'net (SHARE ad3-config /DELETE)' in 'c:\NAntDistributorBuilds\LocalInstallations\ad3config_master_126.96.36.19906' [exec] Users have open files on ad3-config. Continuing the operation will force the files closed. [exec] No valid response was provided. [exec] [exec] Do you want to continue this operation? (Y/N) [N]: [exec] c:\NAntDistributorBuilds\LocalInstallations\ad3config_master_188.8.131.5206\install.build(32,6): [exec] External Program Failed: net (return code was -1) [exec] Starting 'net (SHARE ad3-config="c:\NAntDistributorBuilds\LocalInstallations\ad3config_master_184.108.40.20606" /UNLIMITED)' in 'c:\NAntDistributorBuilds\LocalInstallations\ad3config_master_220.127.116.1106' [exec] The name has already been shared. [exec] [exec] More help is available by typing NET HELPMSG 2118. [exec]
I can't see a way to supply the 'Yes' answer via the command line - there are not /Q switches. The target machine is a Windows 2003 server. Does DOS has an equivalent to the unix 'yes' command?
If I can do it on the command line, then I may be able to do it in NAnt's exec task.