Solved

Need a script that will disable the system restore remotely.

Posted on 2008-06-16
12
1,650 Views
Last Modified: 2008-06-16
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
Comment
Question by:bsharath
  • 7
  • 4
12 Comments
 
LVL 26

Expert Comment

by:farhankazi
ID: 21792241
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
 
LVL 11

Author Comment

by:bsharath
ID: 21792304
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
 
LVL 11

Author Comment

by:bsharath
ID: 21792305
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
 
LVL 26

Accepted Solution

by:
farhankazi earned 500 total points
ID: 21792514

:: 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
 
LVL 11

Author Comment

by:bsharath
ID: 21792542
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
 
LVL 11

Author Comment

by:bsharath
ID: 21792543
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 26

Expert Comment

by:farhankazi
ID: 21792559
First it will stop the service then it will disable the service.
0
 
LVL 11

Author Comment

by:bsharath
ID: 21793523
Ok what does the above code mean...
has it stopped and disabled?
0
 
LVL 26

Expert Comment

by:farhankazi
ID: 21794308
Above output shows that the service is process of STOP.
0
 
LVL 58

Expert Comment

by:tigermatt
ID: 21795486
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
 
LVL 11

Author Comment

by:bsharath
ID: 21795531
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
 
LVL 11

Author Comment

by:bsharath
ID: 21799395
Thanks Farhan
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
vb6 connector to mongodb 2 49
VBA Shell can't Find Word document 11 76
AWS CLI issues with Tags 3 64
Some AHK commands fail in Microsoft OneNote 5 34
Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
This article will show, step by step, how to integrate R code into a R Sweave document
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now