Please can anyone tell me why the command prompt window does'nt close at the end. This is my script Cls @ECHO OFF :Start ECHO Do you wish to logout? set /p answer=Enter Y or N: if /i {%answer%}=={n} goto :Stay if /i {%answer%}=={y} goto :Continue cls goto :Start :Continue TASKKILL /IM "EXPLORER.EXE" /F cls NET USE \\DISKSTATION /DELETE cls EXPLORER.EXE :END EXIT
...Hope this might help. Seems you forgot the ":Stay" - bit...i would suggest leave the "Explorer" entry... @ECHO OFF cls :Start ECHO Do you wish to logout? set /p answer=Enter y or n: if /i {%answer%}=={n} goto :Stay if /i {%answer%}=={y} goto :Continue :Stay goto :Start :Continue cls NET USE \\DISKSTATION /DELETE cls :END EXIT
Thanks for the suggestion. Unfortunately I need to forcefully close the opened explorer window so the network connection can be successfully deleted. Do you have any suggestions how to do that???
@ECHO OFF cls :Start ECHO Do you wish to logout? set /p answer=Enter y or n: if /i {%answer%}=={n} goto :Stay if /i {%answer%}=={y} goto :Continue :Stay goto :Start :Continue TASKKILL /IM "EXPLORER.EXE" /F NET USE \\DISKSTATION /DELETE start EXPLORER.EXE :END EXIT