Methical
Active Member
- Reaction score
- 6
- Location
- Christchurch, New Zealand
Hi guys
I was just after a lil' favour if anyone going to be doing a reinstall of XP in the next few days ..
I'm after the default services for Home/Pro in a batch file.
Heres the batch file here...
Save this with a .bat extension.
If someone would be kind enough to run it, it will generate another batch file with the default services.
Thanks in advance,
Tim
I was just after a lil' favour if anyone going to be doing a reinstall of XP in the next few days ..
I'm after the default services for Home/Pro in a batch file.
Heres the batch file here...
Code:
@echo off
@echo.
@echo Backing up all services 'Startup Type' current state
@echo.
REM Get current date and time
for /f "tokens=1, 2, 3, 4 delims=-/. " %%j in ('Date /T') do set FILENAME=Services_%%j_%%k_%%l_%%m
for /f "tokens=1, 2 delims=: " %%j in ('TIME /T') do set FILENAME=%FILENAME%_%%j_%%k.bat
REM Get all service name
sc query type= service state= all| findstr /r /C:"SERVICE_NAME:" >tmpsrv.txt
echo Saving Service Start State In %FILENAME% ...
REM save service start state into batch file
echo @echo Restore The Service Start State Saved At %TIME% %DATE% >"%FILENAME%"
echo @pause >>"%FILENAME%"
for /f "tokens=2 delims=:" %%j in (tmpsrv.txt) do @( sc qc %%j |findstr START_TYPE >tmpstype.txt && for /f "tokens=4 delims=:_ " %%s in (tmpstype.txt) do @echo sc config %%j start= %%s >>"%FILENAME%")
echo @pause >>"%FILENAME%"
del tmpsrv.txt
del tmpstype.txt
echo Services Start State Saved in %FILENAME%.
@ping 127.0.0.1 -n 3 -w 10 > nul
If someone would be kind enough to run it, it will generate another batch file with the default services.
Thanks in advance,
Tim