Welcome Guest ( Log In | Join )

Discover the best free computer help!
Learn more about Geeks to Go by taking the tour. Want to ask a question, reply to a topic, or remove all advertising? It's easy, fast and free. Join today!
Spyware, virus, trojan, fake security or privacy alerts? Please start with our malware cleaning guide.
     
 
Reply to this topicStart new topic
Batch file for system restore XP and Vista, Any help would be greatly appriciated
bombasos2
post Jul 29 2008, 06:59 PM
Post #1


GeekU Junior
Group Icon
Posts: 92
OS: Windows 2000,XP, Vista



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. This is my first bat that has more then 1 simple command. smile.gif

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 for your help, in advanced. biggrin.gif

This post has been edited by bombasos2: Aug 1 2008, 01:43 PM
Go to the top of the page
 
+Quote Post
Swandog46
post Jul 31 2008, 09:15 AM
Post #2


Malware Expert
Group Icon
Posts: 1,025
OS: Windows XP / Mandrake



This is what the START command is for. See "START /?" for details.
Go to the top of the page
 
+Quote Post
bombasos2
post Aug 2 2008, 12:27 PM
Post #3


GeekU Junior
Group Icon
Posts: 92
OS: Windows 2000,XP, Vista



Thank you.
It turns out the Start command does fix that issue, however I kept using either IF or START but not both, the fix was
CODE
IF EXIST c:\windows\system32\restore\rstrui.exe START c:\windows\system32\restore\rstrui.exe
Go to the top of the page
 
+Quote Post
Swandog46
post Aug 4 2008, 08:55 AM
Post #4


Malware Expert
Group Icon
Posts: 1,025
OS: Windows XP / Mandrake



Yes, that's exactly right. You probably want to abstract away the environmental variables like you did in your first code sample above. Also, using IF EXIST here means if the program doesn't exist, the user will not be informed. I'd do something like:

IF NOT EXIST %systemroot%\system32\restore\rstrui.exe echo "rstrui.exe not found!" & goto Menu
start %systemroot%\system32\restore\rstrui.exe

This post has been edited by Swandog46: Aug 4 2008, 08:56 AM
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Collapse

> Similar Topics

    Topic Title Replies / Views Topic Information
No New Posts 9 / 38,423 12th December 2008 - 07:07 PM
Andy9406 started - last by worf51
No New Posts   1 / 1,038 1st September 2007 - 05:14 PM
dmb83fan41 started - last by dmb83fan41
No New Posts   3 / 1,005 28th November 2007 - 12:37 PM
mark.ison started - last by mark.ison
No New Posts   2 / 290 15th December 2008 - 07:25 PM
tjnguyen started - last by tjnguyen

RSS Time is now: 8th January 2009 - 02:00 AM
Advertisements do not imply our endorsement of that product or service. The forum is run by volunteers who donate their time and expertise. We make every attempt to ensure that the help and advice posted is accurate and will not cause harm to your computer. However, we do not guarantee that they are accurate and they are to be used at your own risk.