Results 1 to 6 of 6

Thread: Batch file for system restore XP and Vista

  1. #1
    Join Date
    Aug 2006
    Posts
    221

    Batch file for system restore XP and Vista

    I have created the batch file which is related to the System Restore in Windows XP and the Windows Vista. When I try to open that file it opens properly in both the Windows XP and Vista, but after opening that batch file I am not able to return to main menu until I close system restore. I can press any key only after closing the batch file. And then I can return to the main menu. Does anyone know the coding so that I can go to the main menu without closing the batch files.?? So, if possible provide me batch file for System Restore of Windows XP and Vista.!!
    AMD Sempron 2800+ @ 2Ghz
    Asus A7V8X-LA
    120Gb Seagate barracuda 7200Rpm Ultra-ATA 100
    Elixir 512mb DDR Pc3200 (Soon 1Gb)
    Club 3D Radeon 9600 256Mb
    Lite-On Cd & Dvd writer combo
    IDE-Dvd drive
    400w Psu
    Windows Xp Pro Sp2
    Advent Wireless Mouse & Keyboard.

  2. #2
    Join Date
    May 2008
    Posts
    2,012

    Re: Batch file for system restore XP and Vista

    It would be better if you provide the coding that you are using. Because to make the whole coding for the Batch file for system restore is very tedious. So if you provide me the coding, I can tell you that were exactly you will have to make the changes, if any. Also are you using the %system% in the batch file for restoring the system?

  3. #3
    Join Date
    May 2008
    Posts
    2,297

    Re: Batch file for system restore XP and Vista

    I can give you the VBScript that need to create a system restore point by a batch file. I think that you should try this :
    Code:
    Set IRP = getobject("winmgmts:\\.\root\default:Systemrestore")
    MYRP = IRP.createrestorepoint ("Restore", 0, 100)
    Hope that you were looking for the same code.

  4. #4
    Join Date
    Aug 2006
    Posts
    221

    Re: Batch file for system restore XP and Vista

    Extremely Thanks Guys..!!! Really feeling good that so many are trying to help. Here is my code that I am trying to use :
    Code:
    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
    Please tell me where I went wrong or Am I missing something.??
    Last edited by Beter 2 Burn Out; 20-01-2010 at 08:19 PM.
    AMD Sempron 2800+ @ 2Ghz
    Asus A7V8X-LA
    120Gb Seagate barracuda 7200Rpm Ultra-ATA 100
    Elixir 512mb DDR Pc3200 (Soon 1Gb)
    Club 3D Radeon 9600 256Mb
    Lite-On Cd & Dvd writer combo
    IDE-Dvd drive
    400w Psu
    Windows Xp Pro Sp2
    Advent Wireless Mouse & Keyboard.

  5. #5
    Join Date
    May 2008
    Posts
    2,012

    Re: Batch file for system restore XP and Vista

    According to me your code should be
    Code:
    IF EXIST c:\windows\system32\restore\rstrui.exe START c:\windows\system32\restore\rstrui.exe
    instead of
    Code:
    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
    Making these changes will definitely help you.

  6. #6
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Batch file for system restore XP and Vista

    The code that you used to make a batch file want to abstract away the environmental variables. Because I think that using the IF EXIST here means if the program doesn't exist, the user will not be informed. So I would like to suggest you to use the following code :
    Code:
    IF NOT EXIST %systemroot%\system32\restore\rstrui.exe echo "rstrui.exe not found!" & goto Menu start %systemroot%\system32\restore\rstrui.exe
    Hope that your problem is fixed.!!

Similar Threads

  1. How Do I Restore/Repair Missing/Corrupt System File?
    By Lupin in forum Windows XP Support
    Replies: 8
    Last Post: 26-07-2011, 12:08 PM
  2. Replies: 10
    Last Post: 08-07-2009, 09:54 AM
  3. How do i do a system restore in Vista
    By Steinbach in forum Operating Systems
    Replies: 3
    Last Post: 07-03-2009, 06:08 PM
  4. Vista Backup and Restore and System Restore points
    By MrChris- in forum Guides & Tutorials
    Replies: 1
    Last Post: 05-01-2009, 09:05 PM
  5. Replies: 2
    Last Post: 10-04-2008, 06:29 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,480,832.69883 seconds with 17 queries