Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1660
  • Last Modified:

Need a script that will disable the system restore remotely.

Hi,

Need a script that will disable the system restore remotely.

Need a way to be able to disable the system restore from all the machines in the file.

Any way to do this...

Need help urgent,.... Many of my machines has got virus within the folder of system restore.

Regards
Sharath
0
bsharath
Asked:
bsharath
  • 7
  • 4
1 Solution
 
Farhan KaziSystems EngineerCommented:
Hi Sharath,

Disable "System Restore Service" service on client machines.
I think you already has a script that read files for computer names and disable mentioned service.
0
 
bsharathAuthor Commented:
Hi Farhan

Yes i have it but not doing it on a list of machines...
Its a per machine script if i am not wrong
0
 
bsharathAuthor Commented:
Hi Farhan

Yes i have it but not doing it on a list of machines...
Its a per machine script if i am not wrong
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Farhan KaziSystems EngineerCommented:

:: BATCH SCRIPT START 
@ECHO OFF
SETLOCAL EnableDelayedExpansion
SET InputFile=Machines.txt
SET OutputFile=SRSDisableStatus.txt
 
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.
:EndScript
ENDLOCAL
EXIT /B 0
:: BATCH SCRIPT END

Open in new window

0
 
bsharathAuthor Commented:
Farhan

Does this just stop or restart

I get this in the file


SERVICE_NAME: srservice
        TYPE               : 20  WIN32_SHARE_PROCESS  
        STATE              : 3  STOP_PENDING
                                (STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x3a98
[SC] ChangeServiceConfig SUCCESS
0
 
bsharathAuthor Commented:
Farhan

Does this just stop or restart

I get this in the file


SERVICE_NAME: srservice
        TYPE               : 20  WIN32_SHARE_PROCESS  
        STATE              : 3  STOP_PENDING
                                (STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x3a98
[SC] ChangeServiceConfig SUCCESS
0
 
Farhan KaziSystems EngineerCommented:
First it will stop the service then it will disable the service.
0
 
bsharathAuthor Commented:
Ok what does the above code mean...
has it stopped and disabled?
0
 
Farhan KaziSystems EngineerCommented:
Above output shows that the service is process of STOP.
0
 
tigermattCommented:
Sharath,

I know you wanted a scripting method to do this, but have you seen the method provided by Group Policy to achieve the same? See http://www.theeldergeek.com/re-enable_system_restore.htm (although do it in Group Policy Management  and not through gpedit.msc!)

Matthew
-tigermatt
0
 
bsharathAuthor Commented:
Matthew but i need to do this just for selected computers that have virus sitting inside the restore folder...
So a script is useful...Any ways thanks for the link would be useful some time....
0
 
bsharathAuthor Commented:
Thanks Farhan
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 7
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now