Question : Windows XP / 7 Script Needed

I am in need of a script that can do the following from a clients hard-drive that I will be connecting externally via SATA IDE adapter:



1. MOVE the users Documents, Photos, Favorites, and Music folder to my local machines desktop in a folder named "BACKUP1"

2A. After step one has been completed. I need the second part of the script to search the remainder of the clients hard-drive for the following types of files:

*.ppt; *.xls; *.pst; *.doc; *.pptx; *.xlsx; *.docx; *.jpg; *.gif; *.png; *.fpt; *.mp3; *.mpg; *.mpeg; *.mov; *.mp4; *.pdf


2B. COPY the found files to the local machine desktop in a folder named "BACKUP2"

COMMENTS: I need the following script to work with Windows XP / Vista and Windows 7.

Answer : Windows XP / 7 Script Needed

There may be better approaches to this, but here's one way to attack it.  You will need to adjust the SET statements near the top to match your needs.  You didn't specify, so I assumed you are only copying one users files, so you will need to identify that.

This uses robocopy, and there are likely other switches that should be used there for logging, or error retries, etc, but I figured get the basic idea out there first.

~bp
1:
2:
3:
4:
5:
6:
7:
8:
9:
@echo off
set FromDrive=D:
set UserName=User
set CopyFolders="music","documents","pictures","favorites"
set CopyFiles=*.ppt,*.xls,*.pst,*.doc,*.pptx,*.xlsx,*.docx,*.jpg,*.gif,*.png,*.fpt,*.mp3,*.mpg,*.mpeg,*.mov,*.mp4,*.pdf
for %%A in (%CopyFolders%) do (
  robocopy "%FromDrive%\Users\%UserName%\%%~A" "C:\Backup1\" /S
)
robocopy "%FromDrive%\" "C:\Backup2\" %CopyFiles% /S
Random Solutions  
 
programming4us programming4us