Hey Guys,
I am a novice to creating batch files and would be grateful for some assistance in getting one
which copies all the users profile data to a network drive (i) in this case.
I would also like there to be a some kind of progress bar indicating the status of the copying.
Really appreciate some help with this..
loco
batch file for copying users profile data to a network drive
Moderator: DosItHelp
Re: batch file for copying users profile data to a network drive
I would take a look at the Robocopy command.
Re: batch file for copying users profile data to a network drive
@Squashman , thanks man
I think I found something decent that should take care of it. But there's a bit more than just the below that I also need to add.
Let's say I also needed to add something which first performs a check on the size of all the files and if they are for example bigger than 5gig
then select a move to onedrive instead, any ideas on how I would go about it. Appreciate any help on this...
@ECHO OFF
SETLOCAL
SET DEST=\\servername\i$\Users\%USERNAME%
ROBOCOPY /MIR /XJ %USERPROFILE%\Documents %DEST%\Documents
ROBOCOPY /MIR /XJ %USERPROFILE%\Desktop %DEST%\Desktop
ROBOCOPY /MIR /XJ %USERPROFILE%\Favorites %DEST%\Favorites
ROBOCOPY /MIR /XJ %USERPROFILE%\Downloads %DEST%\Downloads
ROBOCOPY /MIR /XJ %USERPROFILE%\Appdata %DEST%\Appdata
KR
loco
I think I found something decent that should take care of it. But there's a bit more than just the below that I also need to add.
Let's say I also needed to add something which first performs a check on the size of all the files and if they are for example bigger than 5gig
then select a move to onedrive instead, any ideas on how I would go about it. Appreciate any help on this...
@ECHO OFF
SETLOCAL
SET DEST=\\servername\i$\Users\%USERNAME%
ROBOCOPY /MIR /XJ %USERPROFILE%\Documents %DEST%\Documents
ROBOCOPY /MIR /XJ %USERPROFILE%\Desktop %DEST%\Desktop
ROBOCOPY /MIR /XJ %USERPROFILE%\Favorites %DEST%\Favorites
ROBOCOPY /MIR /XJ %USERPROFILE%\Downloads %DEST%\Downloads
ROBOCOPY /MIR /XJ %USERPROFILE%\Appdata %DEST%\Appdata
KR
loco
Re: batch file for copying users profile data to a network drive
Did you miss reading this in the help file for Robocopy?
Code: Select all
/MAX:n :: MAXimum file size - exclude files bigger than n bytes.
/MIN:n :: MINimum file size - exclude files smaller than n bytes.
Re: batch file for copying users profile data to a network drive
I'll have another look and see if I can figure it out, thanks again.