The first two lines run a fine, service stops, specified directory is emptied out and it ends with no errors and the service hasn't been started.
Any ideas/help much appreciated.
Expand|Select|Wrap|Line Numbers
- NET STOP "service_name"
- DELTREE "C:\temp\"
- NET START "service_name"
Expand|Select|Wrap|Line Numbers
- @echo off
- if {%1}=={} @echo Syntax: DelTree Folder&goto :EOF
- if not exist %1 @echo Syntax: DelTree Folder - Folder %1 does not exist.&goto :EOF
- pushd %1
- if %ERRORLEVEL% NEQ 0 @echo Syntax: DelTree Folder - Folder %1 does not exist.&goto :EOF
- del /q /f "*.*"
- for /f "Tokens=*" %%i in ('dir %1 /B /A /AD') do rd /s /q "%%i"
- popd