Hello.
This is my first attempt at writing a batch script, so go easy on me. lol
I tested this script a few hours ago, and overall, it took about 15-20 minutes to run (~25.5 gigs of data)
As you can see, it's just a simple backup script. But, one thing that's been irking me about it (even though I'm a novice) is that I haven't found any info online (or maybe I'm just using the wrong search terms) on how I can get the script to prompt the user for a backup location.
The location that's listed (F:\Backup_%mm%-%dd%-%yyyy%\) is a local drive on my personal system. However, not everyone will have several hard drives and/or partitions to put the backup on.
With that said, lets assume that the user who runs this script, has an external drive plugged into their system. How can I get the script to prompt them for a location that they can enter?
Also, is there something I can add that will show the user the location of the backup?
For example, when the script is done, it will print out a message that says:
"Backup complete! Your backed up data is located in: X:\Backup_date_of_backup"
Thanks in advance!
Here's my script thus far:
@echo off
echo ***********************************
echo * Vinny's Data Backup Script v1.0 *
echo ***********************************
echo.
echo This script will back up your Itunes music, videos, personal photos,
echo and internet favorites into a folder labeled with todays date,
echo which you can then burn to DVD(s) or copy to an external harddrive.
echo.
pause
echo Creating folders...
Set mm=%DATE:~4,2%
Set dd=%DATE:~7,2%
Set yyyy=%DATE:~10,4%
mkdir F:\Backup_%mm%-%dd%-%yyyy%\Itunes
mkdir F:\Backup_%mm%-%dd%-%yyyy%\Pictures
mkdir F:\Backup_%mm%-%dd%-%yyyy%\Favorites
echo.
echo Done!
echo.
pause
echo Preparing to back up your Internet Bookmarks...
xcopy "%USERPROFILE%\Favorites\*.*" "f:\Backup_%mm%-%dd%-%yyyy%\Favorites\" /e
echo.
echo Preparing to backup your personal photos...
xcopy "%USERPROFILE%\My Documents\My Pictures\*.*" "f:\Backup_%mm%-%dd%-%yyyy%\Pictures\" /e
echo.
echo Preparing to backup your Itunes Library...
xcopy "%USERPROFILE%\My Documents\My Music\iTunes\*.*" "f:\Backup_%mm%-%dd%-%yyyy%\Itunes\" /e
pause
(P.S: Overall thoughts on this script?)