I need batch file(s) that :
# in the beginning wait for 10 seconds
# connecting to a mapped drive : \\192.168.2.5\data to z drive by : net use Z: "\\192.168.2.5\data" /user:michael michaelpasswd
# and after 60 seconds if the "net use" command is not working it will terminate the net use.
We plan to make 2 files : connect.cmd and checkconnection.bat
connect.cmd will consist :
net use Z: "\\192.168.2.5\data" /user:michael michaelpasswd
checkconnection will consist :
IF NOT EXIST Z:\ GOTO FAILURE
net stop "workstation"
net start "workstation"
the problem is :
# the batch file in the beginning doesn't wait for 10 seconds. Do i use the wrong command?
# net stop workstation requires me to enter "y" manually, could i bypass this? so the batch file will run "net stop workstation" without the user enter the key "y"
# we need to terminate the net use. Cause it the server (192.168.2.5) hangs, the computer that connect to it also hangs. will the net stop workstation will do that? to terminate the net use?
Please help. Thank you.