Hi need a script that can disable the system restore,Take ownership and delete the folder. I have some part of the script.
Create a script to
-disable the system restore function
-use command cacls to take ownership of the folder
-delete the folder
Below is the script to disable the system restore. Can the othetr 2 options be added.
Script below is from Farhan.
:: BATCH SCRIPT START
IF NOT EXIST "%InputFile%" ECHO "%InputFile%" file does not exist. &GOTO :EndScript
FOR %%R IN ("%InputFile%") DO IF %%~zR EQU 0 ECHO "%InputFile%" file is empty. &GOTO :EndScript
IF EXIST "%OutputFile%" DEL /F /Q "%OutputFile%"
FOR /F %%c IN ('TYPE "%InputFile%"') DO (
ECHO Processing: %%c
PING -n 1 -w 1000 %%c|Find /I "TTL" >NUL
IF NOT ERRORLEVEL 1 (
SC \\%%c STOP "srservice" >>%OutputFile%
SC \\%%c config "srservice" start= disabled >>%OutputFile%
)ELSE (ECHO Unable to connect %%c: system may be offline.))
ECHO. &ECHO Script complete. Check "%OutputFile%" file.
EXIT /B 0
:: BATCH SCRIPT END