Jump to content

I want to create a small back up utility for my settings, but how?


Recommended Posts

I just had a sudden idea, and because of the impulsive person I am, I decided to ask a question before doing research. Of course, I will be doing the research also, but if there is anyone that can give me a hand with this, it would be great. So, here's my idea:

I use certain programs that save personal settings in a file, like an .inf file or some such thing. Winamp and Opera are the two main ones, but I think HideIP and PeerGaurdian may be in there too... And probably many others. Anyway, I was thinking about WinAmp and my media library, and how the library is saved as a file. My library is large, and it takes around fifteen minutes for it to scan and load everything. I got to thinking, it would be great to make a small utility that backs up all these settings, and saves them as an .exe file, allowing me to just click it and load everything back up onto a fresh system. This way, if I need to re-install everything, my settings will be saved, and I can just click one file afterwards to have all of it back, saving me the trouble of setting everything up again. And if I can do that, I could easily put this file on my unattended disc to run automatically.

I know a bit about batch files, and how to use WinRAR to create executable files. I know there is a way to do this, but I am rather unfamiliar with the structure and commands available within the batch itself. I know that I can use a command like XCOPY, or COPY, to copy from one directory to another. I don't know how to create folders, or how to execute WinRAR from within a batch to archive the created folder into a self extractable archive.

To give you an example of what I want to do:

File A is located at C:\program files\Program A\A.inf

I want to create a folder called Settings and place it at the C prompt (C:\)

Within that folder, I want a series of folders to match the original path of File A [C:\Settings\(program files\Program A)]

I then want to copy File A over to the new folder (C:\Settings\program files\Program A\)

After this, I want to execute WinRAR to create a self extracting archive, with the path C:\, and make it completely silent, and overwrite existing files

I know I need a batch file for this, and I think I can put that file, or a series of files within a self extracting archive, and make a small backup utility for all my settings.

Does anyone have any ideas on how such a batch file should look, or if there is an easier way to do this? If this has already been thought of, or done, could you possibly point me in the direction of that information? Any help would be very much appreciated.

Peace

Link to comment
Share on other sites


Copy, XCopy,....all this is JUST file-base backup.

In Windows a lot of settings stored in Registry.

I would like to recommend you take a look into the NTBACKUP (you do not have to buy anything, NTBACKUP is a part of Windows).

You can use script to run NTBACKUP and do a FULL backup of your system into the file, like BACKUP.bkf....

When you do system reinstall, just do simple Restore (select overite all) and ...reboot and you have everything fully working....

Link to comment
Share on other sites

Thank you very much for your reply. However, the NTBackup utility does not seem to be what I am looking for. If I understand it correctly, it only deals with Windows settings and files, and I want something that does the settings for third party software, like I stated above.

I would like to do exactly what it is I specified, and still have found very little relavent info on the subject. I will continue looking, but if there is anyone here that knows how to write batch files, please help if you can.

Link to comment
Share on other sites

I use .bat, .reg files to save most settings and copy files like winamp.ini (as example). This all takes a lot of research to find out what your programs store their settings in (registry and/or files).

I use a virtual machine , and a program like Total Uninstall to monitor the installation and to monitor changes I make in the settings after install. Checking the log of changes can then give you an overview of all the information that occured during install.

If I just want to monitor changes to settings, I use a dummy exe file , or start an installation monitoring session, and abort the installer. Make changes and then save the snapshot and compare.

Just a few tips, but as I said this requires a bunch of research. It takes some time, but you only usually need to do it once and your good to go. =]

Link to comment
Share on other sites

Ok, I have done some research on my own, and found a bit of stuff. I have learned how to make folders, and have made a test.bat file to see what it does. It works fine in the creation of the folder structure. I already know how to use Xcopy and copy, in a batch file, so I will be incorporating this into the test.bat. Now, my real hang up is getting winrar to do what I want it to, from within the batch file. I found this command online earlier:

"C:\Program Files\WinRAR\RAR.exe" a -esh -m5 -mt2 -r -s -t "Backup.exe" @"files_to_include.txt" -x@"files_to_exclude.txt"
pause

But, I have no clue what all this means. I guess I shouldn't say no clue, because I know that most of it is a string of switches that tells winrar what to do. I also get the basic idea of what it all means. What I have no clue about, is the structure. How do I modify this string, to get winrar to do what I want it to do?

Maybe I need to explain my needs a little deeper here. What I want winrar to do, is make an sfx archive of the previously created folders, that will extract to the proper place when executed. My created folder structure would resemble the root of the C drive, in that within the folder named Backup, there would be the Documents and Settings folder, and the Program Files folder. I want to just archive these folders and all their contents, into an sfx archive, that will extract to the C prompt, overwriting all existing files.

I know that the switch to make winrar create an sfx archive is, -sfx. But beyond that, I have no idea how to incorporate that into the above command line, or how to put it all into the batch to make it work correctly.

Any ideas on this?

Link to comment
Share on other sites

Ok, I have compiled the beginnings of my backup.bat file. This only creates the folders I need, and moves the specified files to the created folders.

@CMDOW @ /HID>NUL 2>&1||@ECHO OFF

SETLOCAL
SET "RPF=%Root%\Program Files"
SET "RBP=%Root%\Backup\Program Files"
SET "RDS=%Root%\Documents and Settings\Administrator\Application Data\Opera\Opera\profile"
SET "RBD=%Root%\Backup\Documents and Settings\Administrator\Application Data\Opera\Opera\profile"

md c:\Backup\"Program Files"\Winamp\plugins
md c:\Backup\"Program Files"\CCleaner
md c:\Backup\"Program Files"\PeerGuardian2
md c:\Backup\"Documents and Settings"\Administrator\"Application Data"\Opera\Opera\profile

COPY "%RPF%\Winamp\Winamp.ini" "%RBP%\Winamp\"
COPY "%RPF%\Winamp\Winamp.bm" "%RBP%\Winamp\"
COPY "%RPF%\Winamp\install.ini" "%RBP%\Winamp\"
COPY "%RPF%\Winamp\plugins\gen_ml.ini" "%RBP%\Winamp\plugins\"
XCOPY "%RPF%\Winamp\plugins\ml" "%RBP%\Winamp\plugins\ml\" /q /i /s /k /c /y /h
COPY "%RPF%\Ccleaner\Ccleaner.ini" "%RBP%\Ccleaner\"
COPY "%RPF%\PeerGuardian2\pg2.conf" "%RBP%\PeerGuardian2\"
COPY "%RDS%\Opera6.ini" "%RBD%\Opera6.ini"

cls
exit

this code works, and does exactly what I want it to do, but I still can't figure out how to execute winrar from within this batch file to silently archive these folders into an sfx file. I will keep looking for answers, but would still like to hear your ideas.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...