I am using below sql statement to create shared folder with permission
EXEC xp_cmdshell 'net share BackupSharedFolder=D:\testshared /REMARK:"test shared"'
It is working fine with create shed folder.
then i will use below sql command to remove shared EXEC xp_cmdshell ' net share BackupSharedFolder /delete"'
Above is also working fine if shared folder is not opened.
if shared folder is opened.It giving error like following "Users have open files on BackupSharedFolder. Continuing the operation will force the files closed. Do you want to continue this operation? (Y/N) [N]: No valid response was provided."
and ask for prompt for Yes or NO.
So, how can i force sql command to yes and remove share by this XEC xp_cmdshell ' net share BackupSharedFolder /delete".