Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Batch file for system restore XP and Vista


  • Please log in to reply

#1
bombasos2

bombasos2

    Member

  • Member
  • PipPipPip
  • 198 posts
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. :)

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. :)

Edited by bombasos2, 01 August 2008 - 01:43 PM.

  • 0

Advertisements


#2
Swandog46

Swandog46

    Malware Expert

  • Member
  • PipPipPipPip
  • 1,026 posts
  • MVP
This is what the START command is for. See "START /?" for details.
  • 0

#3
bombasos2

bombasos2

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 198 posts
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
IF EXIST c:\windows\system32\restore\rstrui.exe START c:\windows\system32\restore\rstrui.exe

  • 0

#4
Swandog46

Swandog46

    Malware Expert

  • Member
  • PipPipPipPip
  • 1,026 posts
  • MVP
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

Edited by Swandog46, 04 August 2008 - 08:56 AM.

  • 0

#5
SomeCrazyStuff

SomeCrazyStuff

    Member

  • Member
  • PipPipPip
  • 401 posts
hey just curious.. does this make a new system restor point? if not what exactly does this batch file do?
  • 0

#6
bombasos2

bombasos2

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 198 posts
SomeCrazyStuff,
No it does not make a system restore point on its own, instead launches the system restore GUI. The batch has multiple commands that launch a utility. I added a couple of things like launching device manager, msconfig, and ftp download of firefox among others. I made it with the intent of phone support for family and friends. Instead of trying to open command prompt and spelling ipconifg its a lot easier to have them press 1 and then press 2.

For example,

Double click on batch.bat

Hit 1 to access "network utilities" and then 2 to access "what is my IP?"

Now we get some results back and can direct them further.



Believe it or not I actually lost a pretty completed version that was stored on my flash drive. Recently I have seen a need for it again and when I am done if you or anyone is interested I will share it.


If you do figure out how to make one that makes a system restore point on its own let me know so that I can incorporate it.

Thanks,

bombasos2
  • 0

#7
SomeCrazyStuff

SomeCrazyStuff

    Member

  • Member
  • PipPipPip
  • 401 posts
Bombasos2,

Thanks for the reply!

I would love to help you out with the system restore point part, but i dont know what half of what you have there does. I understand it the way you explained it. But aside from that, I'm not familiar enough with the coding to say what each line does.

But yes, Please post the completed form of it when you do come by it. I would love to have that!
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP