Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

A Bat File For System Restore In Xp And Vista


  • Please log in to reply
4 replies to this topic

#1 Bombasos2

Bombasos2

  • Members
  • 8 posts
  • OFFLINE
  •  
  • Local time:01:55 AM

Posted 01 August 2008 - 02:47 PM

Ok, so I have the batch file, it runs fine and opens the system restore in both XP and Vista, however when system restore opens the bat does not allow me to return to main menu until I close system restore. Once I close it allows me to press any key and returns to menu. I was wondering if there is a way to make it display system restore and let me go to the main menu for the bat without having to close it first
runas /user:local\administrator
@echo off
title Test Utility
:prompt
color 4f
cls
echo Pick a Category
echo.
echo Type 1 to System Utilities
echo Type 2 to ""
echo Type 3 to ""

set /p answer=
if %answer% == 1 system

:system
cls
Echo Type 1 to System Restore
Echo Type 2 to ""
Echo Type 15 to Main Menu

set /p answer=
if '%answer%' == '1' goto system restore

:system restore
cls
IF EXIST %systemroot%\system32\restore\rstrui.exe= %systemroot%\system32\restore\rstrui.exe else
IF EXIST C:\Windows\System32\rstrui.exe = C:\Windows\System32\rstrui.exe
echo.
echo Pres Any Key to goto Menu
pause >nul
goto prompt


Thank you,
:thumbsup:

BC AdBot (Login to Remove)

 


#2 M...

M...

  • Members
  • 386 posts
  • OFFLINE
  •  
  • Local time:10:55 PM

Posted 01 August 2008 - 04:20 PM

Hello Bombasos2,

I think you may want to try using the start command in your batch file.

Rather than specifying

abc.exe ...

to run a program called abc.exe, use

start ... abc.exe ...

I'll leave it up to you to investigate the options and experiment with them:

http://technet.microsoft.com/en-us/library/bb491005.aspx

#3 Bombasos2

Bombasos2
  • Topic Starter

  • Members
  • 8 posts
  • OFFLINE
  •  
  • Local time:01:55 AM

Posted 01 August 2008 - 07:45 PM

So I try to put start before the commands and I can't get it to work. Either the same thing happens or command prompts open but no System restore. I have tried just Start, Start /D path, Start path, and Start /I brings it up but with an error message of The parameter is incorrect. Were you able to do it sucessfully?

#4 M...

M...

  • Members
  • 386 posts
  • OFFLINE
  •  
  • Local time:10:55 PM

Posted 01 August 2008 - 09:19 PM

Try this in a simple batch file:

IF EXIST c:\windows\system32\restore\rstrui.exe START c:\windows\system32\restore\rstrui.exe
ECHO zzzzzzzzzzzz
PAUSE


You can interact with the command prompt window (i.e., to close it in this case) while the System Restore dialog is still active.

Edited by M..., 01 August 2008 - 09:34 PM.


#5 Bombasos2

Bombasos2
  • Topic Starter

  • Members
  • 8 posts
  • OFFLINE
  •  
  • Local time:01:55 AM

Posted 02 August 2008 - 01:02 PM

:thumbsup: Thank you so much, that actually worked. I was trying the start command but never the start and if together. That works just like I wanted to.
:flowers:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users