I would like to automatically delete a mapped network drive from a batch file on Windows after perfoming several commands.
This is my script:
myscript.bat:
net use X: \\myserver\myfolder
pushd X:
dir
net use X: /delete
after listing the files the following message is prompted:
Is it OK to continue disconnecting and force them closed? (Y/N) [N]:
and the script waits for manual user input. I have tried
echo y | net use X: /delete
but the following message is displayed
No valid response was provided.
and again the script waits for manual user input.