To Richard and anyone else following this thread
Hello Trevor,
I like what your doing with the if statements and such. Don't
suppose you would be willing to copy-and-paste your batch file here
so I (we) can see the whole thing?
My batch file is as follwos. Note that the xcopy commands are actually on
one line, although this may not matter (not sure).
:: backup.bat
:: Remove remarks to copy one-off folders
@setlocal enableextensions
@if errorlevel 1 @echo Unable to enable extensions
@if not errorlevel 1 @echo Extensions enabled
@echo.
@echo Backup selected folders to F: Drive
@echo =======================
@echo NOTE: RESPONSE REQUIRED
@echo =======================
@echo (Do not just Enter)
@echo.
@echo Selected Docs and Settings
@echo --------------------------
@set /P inp1=Copy Desktop folder (Y/N)?
@set /P inp2=Copy Favorites folder (Y/N)?
@set /P inp3=Copy OE folder (Y/N)?
@set /P inp4=Copy Start Menu folder (Y/N)?
@set /P inp5=Copy My Documents folder (Y/N)?
@echo.
@echo Other selected C: Folders
@echo -------------------------
@set /P inp6=Copy Batch Files folder (Y/N)?
@set /P inp7=Copy Downloads folder (Y/N)?
@set /P inp8=Copy Program Files folder (Y/N)?
@echo.
@rem @echo Other one-off selected C: Folders
@rem @echo ---------------------------------
@rem @set /P inp9=Copy Perl folder (Y/N)?
@rem @set /P inp10=Copy XP Pro folder (Y/N)?
@rem @echo.
@if %inp1%==y set inp1=Y
@if %inp2%==y set inp2=Y
@if %inp3%==y set inp3=Y
@if %inp4%==y set inp4=Y
@if %inp5%==y set inp5=Y
@if %inp6%==y set inp6=Y
@if %inp7%==y set inp7=Y
@if %inp8%==y set inp8=Y
@rem @if %inp9%==y set inp9=Y
@rem @if %inp10%==y set inp10=Y
@echo These will be copied
@echo ====================
@if %inp1%==Y @echo Desktop
@if %inp2%==Y @echo Favorites
@if %inp3%==Y @echo OE
@if %inp4%==Y @echo Start Menu
@if %inp5%==Y @echo My Documents
@if %inp6%==Y @echo Batch Files
@if %inp7%==Y @echo Downloads
@if %inp8%==Y @echo Program Files
@rem @if %inp9%==Y @echo Perl
@rem @if %inp10%==Y @echo XP Pro
@echo.
@set /P cont=Continue (Y/N)?
@if %cont%==y set cont=Y
@echo.
@if not %cont%==Y @echo Copy aborted
@if not %cont%==Y goto endbat
@if %inp1%==Y @echo Copying Desktop
@if %inp1%==Y xcopy "%USERPROFILE%\Desktop\*.*" "F:\0 C_Backup\Documents
and Settings\Trevor\Desktop" /D /E /C /I /Q /H /R /K /Y
@echo.
@if %inp2%==Y @echo Copying Favorites
@if %inp2%==Y xcopy "%USERPROFILE%\Favorites\*.*" "F:\0 C_Backup\Documents
and Settings\Trevor\Favorites" /D /E /C /I /Q /H /R /K /Y
@echo.
@if %inp3%==Y @echo Copying OE
@if %inp3%==Y xcopy "%USERPROFILE%\Local Settings\Application
Data\Identities\{83FDBF62-3205-46F3-BAE6-6D4B94BB0594}\Microsoft\Outlook
Express\*.*" "F:\0 C_Backup\Documents and Settings\Trevor\Email" /D /E /C /I
/Q /H /R /K /Y
@echo.
@if %inp4%==Y @echo Copying Start Menu
@if %inp4%==Y xcopy "C:\Documents and Settings\All Users\Start Menu\*.*"
"F:\0 C_Backup\Documents and Settings\All Users\Start Menu\" /D /E /C /I /Q
/H /R /K /Y
@if %inp4%==Y xcopy "%USERPROFILE%\Start Menu\*.*" "F:\0 C_Backup\Documents
and Settings\Trevor\Start Menu" /D /E /C /I /Q /H /R /K /Y
@echo.
@if %inp5%==Y @echo Copying My Documents
@if %inp5%==Y xcopy "%USERPROFILE%\My Documents\*.*" "F:\0
C_Backup\Documents and Settings\Trevor\My Documents" /D /E /C /I /Q /H /R /K
/Y /EXCLUDE:excl.txt
@echo.
@if %inp6%==Y @echo Copying Batch Files
@if %inp6%==Y xcopy "C:\Batch Files\*.*" "F:\0 C_Backup\Batch Files" /D /E
/C /I /Q /H /R /K /Y
@echo.
@if %inp7%==Y @echo Copying Downloads
@if %inp7%==Y xcopy "C:\Downloads\*.*" "F:\0 C_Backup\Downloads" /D /E /C
/I /Q /H /R /K /Y
@echo.
@if %inp8%==Y @echo Copying Program Files
@if %inp8%==Y xcopy "C:\Program Files\*.*" "F:\0 C_Backup\Program Files" /D
/E /C /I /Q /H /R /K /Y
@echo.
@rem @if %inp9%==Y @echo Copying Perl
@rem @if %inp9%==Y xcopy "C:\Perl\*.*" "F:\0 C_Backup\Perl" /D /E /C /I /Q
/H /R /K /Y
@rem @echo.
@rem @if %inp10%==Y @echo Copying XP Pro
@rem @if %inp10%==Y xcopy "C:\XP Pro\*.*" "F:\0 C_Backup\XP Pro" /D /E /C /I
/Q /H /R /K /Y
@rem @echo.
@echo Copy complete
:endbat
@echo.
@pause
My exclude file (excl.txt) is
\My Received Files\
\My Pictures\
This has to vary when I have different needs for copying My Documents
Is there a good online source for looking up the methods. Or maybe a
listing of the commands and
parameters and variables that can be used within a batch file.
Well, I have been searching and I have found a few.
One is The 10 Batch File Commands
http://www.cs.ntu.edu.au/homepages/bea/home/subjects/ith305/description.html
Microsoft also has some references. One is:
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/batch.mspx?mfr=true
I also found a document called DOS Command Reference. I can't remember the
source, so I have placed it on
http://tandcl.homemail.com.au/DOS Command Reference.zip
so you can download it within, say the next week (when I will delete it).
Glad to know you got something working the way you like. But don't
forget to look into xxcopy.exe. It is supposed to synchronize where
xcopy won't.
Yes, I have it mind to do.
Maybe I should revisit your web site... it's been awhile.
Well, the main thing that changes are the 5 sites listed under the heading
*Fotopic.Net* on the page "Picture Album". They probably change every day or
three, but not by all that much - it might be 10 -20 on one day and one some
days none at all.
Take care, tell the wife I said hello from Virginia (USA).
Yes, I have. She said that, while she appeciated the compliments on the
site, that I (Trevor) should remember that quite a few of the pictures are
mine. This is true, but she does the hard slog of scanning photos and
putting them up on the web.