Go Back   PCMech Forums > Windows Support > Windows Tips, Tricks, and Tweaks

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 10-05-2000, 04:38 PM   #1
Member (9 bit)
 
Join Date: Mar 2000
Posts: 457
Cab2Reg.bat is a batch file I created some time ago before learning of Scanreg.exe. Like Scanreg it can restore Windows98 RB***.cab files. Cab2Reg.bat it has two advantages over Scanreg.exe. Not only can it display the contents of each .CAB, but also gives the option to restore the individual files within .CAB.

Originally it handled the 6 RB***.CAB's. After finding out how to increase the number of .CAB's in Scanreg.ini (MaxBackupCopies=9), I expanded Cab2Reg's capability to 10 (0-9).

I'm open to suggestion for improvements. I know there's redundant code but my batch file knowledge is somewhat limited.


rem {begin cut here}-------------
@echo off
c:
cls
echo Danny (MadMax) Cooper's Cab2Reg.bat,
echo a Win98 crash recovery tool.
echo Version 1.5 Oct 5, 2000
echo --------------------------------------------------------------
echo Copyright (c) 2000 Danny Cooper
echo.
echo Use Notepad to view this file's contents before running!
echo Who knows, you may learn a little about DOS.
:: This file is offered as-is and without warranty of any kind.
:: This file may redistributed as long as all header information
:: is retained in the final file.
echo ---------------------------------------------------------------
echo This file displays and or restores up to 9 .CAB Windows 98 backups
echo in case of a system crash.
echo.
pause

:Top
cd C:\Windows\Sysbckup
DIR /od C:RB0*.CAB > c:\cablist
FIND "RB" c:\cablist
echo.
echo Restore Display
IF EXIST C:RB000.cab echo RB000.CAB 0 A
IF EXIST C:RB001.cab echo RB001.CAB 1 B
IF EXIST C:RB002.cab echo RB002.CAB 2 C
IF EXIST C:RB003.cab echo RB003.CAB 3 D
IF EXIST C:RB004.cab echo RB004.CAB 4 E
IF EXIST C:RB005.cab echo RB005.CAB 5 F
IF EXIST C:RB006.cab echo RB006.CAB 6 G
IF EXIST C:RB007.cab echo RB007.CAB 7 H
IF EXIST C:RB008.cab echo RB008.CAB 8 I
IF EXIST C:RB009.cab echo RB009.CAB 9 J

echo.
echo.
CHOICE /c:0A1B2C3D4E5F6G7H8I9JX /nPress X to Exit....or....Make Choice

IF ERRORLEVEL 21 GOTO END

IF ERRORLEVEL 20 GOTO RB9
IF ERRORLEVEL 19 GOTO RB9
IF ERRORLEVEL 18 GOTO RB8
IF ERRORLEVEL 17 GOTO RB8
IF ERRORLEVEL 16 GOTO RB7
IF ERRORLEVEL 15 GOTO RB7
IF ERRORLEVEL 14 GOTO RB6
IF ERRORLEVEL 13 GOTO RB6
IF ERRORLEVEL 12 GOTO RB5
IF ERRORLEVEL 11 GOTO RB5
IF ERRORLEVEL 10 GOTO RB4
IF ERRORLEVEL 9 GOTO RB4
IF ERRORLEVEL 8 GOTO RB3
IF ERRORLEVEL 7 GOTO RB3
IF ERRORLEVEL 6 GOTO RB2
IF ERRORLEVEL 5 GOTO RB2
IF ERRORLEVEL 4 GOTO RB1
IF ERRORLEVEL 3 GOTO RB1
IF ERRORLEVEL 2 GOTO RB0
IF ERRORLEVEL 1 GOTO RB0


:RB9
IF NOT EXIST C:RB009.cab echo RB009.CAB Not Available
IF NOT EXIST C:RB009.cab GOTO zZ
cls
IF ERRORLEVEL 20 Extract /d C:RB009.cab
IF NOT ERRORLEVEL 4 PAUSE
IF NOT ERRORLEVEL 19 GOTO Top
cd ..
IF ERRORLEVEL 19 Extract /e c:\windows\sysbckup\rb009.cab
cls
goto Top


:RB8
IF NOT EXIST C:RB008.cab echo RB008.CAB Not Available
IF NOT EXIST C:RB008.cab GOTO zZ
cls
IF ERRORLEVEL 18 Extract /d C:RB008.cab
IF NOT ERRORLEVEL 4 PAUSE
IF NOT ERRORLEVEL 17 GOTO Top
cd ..
IF ERRORLEVEL 17 Extract /e c:\windows\sysbckup\rb008.cab
cls
goto Top

:RB7
IF NOT EXIST C:RB007.cab echo RB007.CAB Not Available
IF NOT EXIST C:RB007.cab GOTO zZ
cls
IF ERRORLEVEL 16 Extract /d C:RB007.cab
IF NOT ERRORLEVEL 4 PAUSE
IF NOT ERRORLEVEL 15 GOTO Top
cd ..
IF ERRORLEVEL 15 Extract /e c:\windows\sysbckup\rb007.cab
cls
goto Top

:RB6
IF NOT EXIST C:RB006.cab echo RB006.CAB Not Available
IF NOT EXIST C:RB006.cab GOTO zZ
cls
IF ERRORLEVEL 14 Extract /d C:RB006.cab
IF NOT ERRORLEVEL 4 PAUSE
IF NOT ERRORLEVEL 13 GOTO Top
cd ..
IF ERRORLEVEL 13 Extract /e c:\windows\sysbckup\rb006.cab
cls
goto Top

:RB5
IF NOT EXIST C:RB005.cab echo RB005.CAB Not Available
IF NOT EXIST C:RB005.cab GOTO zZ
cls
IF ERRORLEVEL 12 Extract /d C:RB005.cab
IF NOT ERRORLEVEL 4 PAUSE
IF NOT ERRORLEVEL 11 GOTO Top
cd ..
IF ERRORLEVEL 11 Extract /e c:\windows\sysbckup\rb005.cab
cls
goto Top

:RB4
IF NOT EXIST C:RB004.cab echo RB004.CAB Not Available
IF NOT EXIST C:RB004.cab GOTO zZ
cls
IF ERRORLEVEL 10 Extract /d C:RB004.cab
IF NOT ERRORLEVEL 4 PAUSE
IF NOT ERRORLEVEL 9 GOTO Top
cd ..
IF ERRORLEVEL 9 Extract /e c:\windows\sysbckup\rb004.cab
cls
goto Top

:RB3
IF NOT EXIST C:RB003.cab echo RB003.CAB Not Available
IF NOT EXIST C:RB003.cab GOTO zZ
cls
IF ERRORLEVEL 8 Extract /d C:RB003.cab
IF NOT ERRORLEVEL 4 PAUSE
IF NOT ERRORLEVEL 7 GOTO Top
cd..
IF ERRORLEVEL 7 Extract /e c:\windows\sysbckup\rb003.cab
cls
goto Top

:RB2
IF NOT EXIST C:RB002.cab echo RB002.CAB Not Available
IF NOT EXIST C:RB002.cab GOTO zZ
cls
IF ERRORLEVEL 6 Extract /d C:RB002.cab
IF NOT ERRORLEVEL 4 PAUSE
IF NOT ERRORLEVEL 5 GOTO Top
cd ..
IF ERRORLEVEL 5 Extract /e c:\windows\sysbckup\rb002.cab
cls
goto Top

:RB1
IF NOT EXIST C:RB001.cab echo RB001.CAB Not Available
IF NOT EXIST C:RB001.cab GOTO zZ
cls
IF ERRORLEVEL 4 Extract /d C:RB001.cab
IF NOT ERRORLEVEL 5 PAUSE
IF NOT ERRORLEVEL 3 GOTO Top
cd ..
IF ERRORLEVEL 3 Extract /e c:\windows\sysbckup\rb001.cab
cls
goto Top

:RB0
IF NOT EXIST C:RB000.cab echo RB000.CAB Not Available
IF NOT EXIST C:RB000.cab GOTO zZ
cls
IF ERRORLEVEL 2 Extract /d C:RB000.cab
IF NOT ERRORLEVEL 4 PAUSE
IF NOT ERRORLEVEL 1 GOTO Top
CD ..
IF ERRORLEVEL 1 Extract /e c:\windows\sysbckup\rb000.cab
CLS
GOTO Top

:zZ
pause
cls
goto Top

:END
cd c:\
del c:cablist
cls
rem {end cut here}----------------------------------------
MadMax is offline   Reply With Quote
Old 10-05-2000, 04:54 PM   #2
Member (14 bit)
 
reboot's Avatar
 
Join Date: Mar 1999
Location: Kelowna, B.C., Canada
Posts: 9,138
Nice .bat file!
Why don't you write a .bat that will backup the windows95 registry 10 times (once per day like win98) and store it in the same place as win98?
Then this could be used on all versions of Win9x.

Does anybody know if Windows ME keeps the 5 registry backups in the same place? Does it keep reg backups at all?
__________________
Black holes are where God divided by zero...
Cheers, Jim

Jims Modems
reboot is offline   Reply With Quote
Old 10-05-2000, 08:23 PM   #3
Red-eyed Moderator
Staff
Premium Member
 
HAL9000's Avatar
 
Join Date: Dec 1999
Location: Regina, Saskatchewan, Canada
Posts: 17,575
I haven't checked deeply into what ME is keeping for a backup, but when I loaded ME I was having a video driver issue and really messed up my system. I decided to put the system restore to the test. It literally restored EVERYTHING. I had deleted my Bitware folder and manually hacked out references in the SYSTEM.INI and registry (there was no uninstall for bitware). When I ran the restore, it put the registry references back. A quick check to the SYSTEM.INI and everything was put back there as well. Then the kicker, the Bitware folder and all the files were back as well even though this had been deleted and the recycle bin emptied several days ealier.
__________________
-At Ford, quality is job #1, job #2 is making them explode. ~Norm MacDonald, SNL News

-Switching to Glide..Balancing in my head..inside of me...
taking the glide path instead.
HAL9000 is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 07:05 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2