[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.1

DOS batch file backup script

Asked by parcou in MS DOS, Windows XP Operating System

Tags: dos, windows xp

How can I modify the code\script below to:
-exclude specific file types (eg. mp3, m4a, mpg, etc)
-hide\mask the error message when it searches for the SD\USB drive name on each pass
-run minimized (optional)

Goal: We have laptops with SD drives and I have added a 32GB SD to each PC. I want to run an automated backup controlled by a batch file (see code below) and use Windows Task Scheduler to kick off the backup at a scheduled time daily. Yeah poor man way but boss will not offer any assistance so I have to work with a homebrew :-) My users need a backup safety net...

---------
I have a DOS code below created by one of the great users here. It works great but I need to take it up a notch.

-The script will search for a USB (SD soon) drive name 'IMG DRV' or whatever I call it

-Currently it is set to search drive letters (C,D,E,F,G,I,J). I usually do not see letters higher than J. Beforehand it was set all the way to 'Z' but it hangs on network drives until it times out.

-I get an error (nothing major but will alarm users) when running the drive look-up cycle until it finds the correct drive letter. I added the 'cls' between the script below to try clearing it on each drive letter look-up pass. Beforehand it listed a drive look-up error for each following letter on a new line until the drive was finally found. I WOULD LIKE to hide/mask that if possible until the letter is found.

(extracted from the code below)
"%%y"=="%testfor%" set drive=%test%:
cls <--- I added this was not there before......
goto end

-Last part of the code will copy the needed data to a USB drive or in my case will be the attached SD drive on the laptop. I WILL ADD more lines of data in the script to backup but I want to EXCLUDE certain file types like (music, movies, videos, etc). How can I do that?

Please help me modify or rewrite this code if needed for my two (three) main questions above. My DOS knowledge is beginner.

Thx
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
@echo off
 
REM ---------
REM BACKUP
REM ---------
ECHO -------------------------------------------------------
ECHO CLOSE ALL PROGRAMS and APPLICATIONS NOW!!
ECHO -------------------------------------------------------
ECHO.
ECHO Your hard drive is about to be searched for Documents,
ECHO Databases, Spreadsheets, and Email storage files.
ECHO.
ECHO All files of these types will be saved to 
ECHO your REMOVABLE DEVICE in their original
ECHO directories\folders.
ECHO.
ECHO This will replace any previous backup on the
ECHO removable drive.
ECHO.
 
PAUSE
 
 
REM -------------------------------------------------------------------------------------
REM Finding Removable Drive Letter Code...
REM -------------------------------------------------------------------------------------
 
REM The string below will be for the DRIVE Name eg. set testfor=ABS
set testfor=IMG_DRV
set drive=unknown
 
for %%a in (C,D,E,F,G,I,J) do call :testdrive %%a
goto continue
 
:testdrive
set test=%1
REM Use Dir to get drive label.  Sets drive variable
for /f "tokens=5,*" %%x in ('dir %test%:\*.* 2^>NUL ^| find /i "volume in drive"') do if /i "%%y"=="%testfor%" set drive=%test%:
cls
goto end
 
:continue
cls
echo.
echo USB drive was found...
echo.
echo The drive name is. %testfor% 
echo Drive letter is.  %drive%
echo.
echo.
REM xcopy c:\source\*.* %drive%\backup /e /i /y
 
pause
cls
 
 
 
REM -------------------------------------------------------------------------------------
REM Starting Backup Routine...
REM -------------------------------------------------------------------------------------
 
ECHO Copying "My Documents" Folder to Backup device...
ECHO.
ECHO.
xcopy "c:\Documents and Settings\%username%\My Documents\*.*" "%drive%\_Rep_Backup\%username%\My Documents" /e /i /y
 
ECHO.
ECHO.
 
ECHO Copying "Desktop" Folder to Backup device...
ECHO.
ECHO.
xcopy "c:\Documents and Settings\%username%\Desktop\*.*" "%drive%\_Rep_Backup\%username%\Desktop" /e /i /y
 
ECHO.
ECHO.
 
ECHO Copying "Favorites" Folder to Backup device...
ECHO.
ECHO.
xcopy "c:\Documents and Settings\%username%\Favorites\*.*" "%drive%\_Rep_Backup\%username%\Favorites" /e /i /y
 
ECHO.
ECHO.
 
ECHO Copying "Email Storage" Folder to Backup device...
ECHO.
ECHO.
xcopy "C:\Documents and Settings\%username%\Local Settings\Application Data\Microsoft\Outlook\*.pst" "%drive%\_Rep_Backup\%username%\Outlook\" /e /h /i /y
 
ECHO.
ECHO.
 
ECHO Copying "Email Nickname File" Folder to Backup device...
ECHO.
ECHO.
xcopy "C:\Documents and Settings\%username%\Application Data\Microsoft\Outlook\*.nk2" "%drive%\_Rep_Backup\%username%\Outlook_NK2\" /e /h /i /y
 
ECHO.
ECHO.
 
ECHO Copying "AXSOne" Folder to Backup device...
ECHO.
ECHO.
xcopy "C:\AXSOne\*.*" "%drive%\_Rep_Backup\%username%\AXSOne" /e /h /i /y
 
ECHO.
ECHO.
 
ECHO Copying "Siebel-SROC Database" Folder to Backup device...
ECHO.
ECHO.
xcopy "C:\Program Files\Siebel\7.7\web client\LOCAL\*.*" "%drive%\_Rep_Backup\%username%\SROC\Local" /e /i /y
 
ECHO.
ECHO.
 
ECHO Copying "I-ROAM Database" Folder to Backup device...
ECHO.
ECHO.
xcopy "C:\Program Files\NikeGolf I-ROAM\*.sdf" "%drive%\_Rep_Backup\%username%\IROAM" /e /i /y
 
ECHO.
ECHO.
 
ECHO Copying "Wallpaper" Folder to Backup device...
ECHO.
ECHO.
xcopy "C:\Documents and Settings\%username%\Local Settings\Application Data\Microsoft\*.bmp" "%drive%\_Rep_Backup\%username%\" /e /h /i /y
 
 
dir %drive%\_Rep_Backup\%username%\ /s > %drive%\_Rep_Backup\%username%\backup_log.txt
 
 
 
cls
ECHO.
ECHO Your BACKUP has been completed!!!.  
ECHO It is located on your removable device
ECHO in a folder called: _Rep_Backup
ECHO.
ECHO You may disconnect your device from the PC!
ECHO.
ECHO Please continue to periodically backup...
ECHO.
ECHO.
ECHO Systems Tech Support
ECHO.
PAUSE
[+][-]04/21/09 06:53 AM, ID: 24194312Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04/21/09 07:07 AM, ID: 24194516Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/21/09 07:51 AM, ID: 24195073Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/21/09 08:31 AM, ID: 24195575Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/21/09 08:47 AM, ID: 24195794Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/21/09 08:49 AM, ID: 24195807Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/21/09 09:13 AM, ID: 24196053Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/21/09 09:18 AM, ID: 24196104Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/21/09 09:19 AM, ID: 24196116Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/21/09 09:31 AM, ID: 24196252Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/26/09 10:27 PM, ID: 24239049Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/26/09 11:15 PM, ID: 24239200Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/27/09 12:07 AM, ID: 24239390Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/27/09 08:15 AM, ID: 24242612Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/27/09 09:04 AM, ID: 24243112Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/27/09 11:29 AM, ID: 24244323Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: MS DOS, Windows XP Operating System
Tags: dos, windows xp
Sign Up Now!
Solution Provided By: AmazingTech
Participating Experts: 2
Solution Grade: A
 
 
Loading Advertisement...
20091021-EE-VQP-81 - Hierarchy / EE_QW_3_20080625