By gekko8Created 24 Apr 2013, Modified 27 May 2013
My Rating:
Vote
Rating:
(2 votes)
Views:3973
Downloads:81
Source:

Backup UserProfile

Language:  Batch File

Compatibility

Windows XP Yes Windows 2003 Unknown
Windows 2000 Unknown Windows NT Unknown
Vista Unknown Windows 2008 Unknown
Description

This batch will backup the current users 'Desktop', 'My Documents', 'Favorites', 'Internet Explorer Wallpaper' (if exists), (local) 'Wallpaper1' (if exists) and the 'Custom' theme (they may be currently running) and puts it all into a folder with the name/date format '%UserProfile As Of %MM.DD.YYYY'. The 'Z:' drive was used in the example here. To specify your destination just replace the 'Z:' with your drive path. UNC Pathing is also supported.

Code

Line Numbers: On  Off      Plain Text
XCOPY /I /F /H /E "%USERPROFILE%\Desktop\*.*" Z:\"%USERNAME% As Of %date:~-10,2%.%date:~-7,2%.%date:~-4,4%\Desktop\*.*"

XCOPY /I /F /H /E "%USERPROFILE%\My Documents" Z:\"%USERNAME% As Of %date:~-10,2%.%date:~-7,2%.%date:~-4,4%\My Documents\*.*"

XCOPY /I /F /H /E "%USERPROFILE%\Favorites\*.*" Z:\"%USERNAME% As Of %date:~-10,2%.%date:~-7,2%.%date:~-4,4%\Favorites\*.*"


XCOPY "%USERPROFILE%\Application Data\Microsoft\Internet Explorer\Internet Explorer Wallpaper.bmp" Z:\"%username% As Of %date:~-10,2%.%date:~-7,2%.%date:~-4,4%\"

XCOPY "%USERPROFILE%\Local Settings\Application Data\Microsoft\Wallpaper1.bmp" Z:\"%username% As Of %date:~-10,2%.%date:~-7,2%.%date:~-4,4%\"


XCOPY "%USERPROFILE%\Application Data\Microsoft\Windows\Themes\Custom.theme" Z:\"%username% As Of %date:~-10,2%.%date:~-7,2%.%date:~-4,4%\"

RENAME "Z:\%username% As Of %date:~-10,2%.%date:~-7,2%.%date:~-4,4%\Custom.theme" "%username% As Of %date:~-10,2%.%date:~-7,2%.%date:~-4,4%.theme"

 


Got a useful script? Click here to upload!


 

  Post Comment
Order By:  
User Comments
      
tupz
Posted On: 5/29/2013 7:09:19 AM

nice! thanks for this