Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Backing up a user profile

Jul
304
0
I wouldn't use EXCEPT. It's a kludgey holdover from MS-DOS days. Use exclusion ranges instead:

Code:
copy /[!ntuser.dat ntuser.dat.log ntuser.ini documents\] /a: /s /v /g /md "%userprofile\*" "d:\backup %_datetime\"
 
Note to Rex: HELP FILEXRANGES really ought to document DIRNAME\ to exclude subdirectories.
 
Chasrles, many thanks! What is the a: though? I get that the "d:\backup %_datetime\" designates the destination (on drive d?), but the a:?
 
Chasrles, many thanks! What is the a: though? I get that the "d:\backup %_datetime\" designates the destination (on drive d?), but the a:?

COPY /A: copies files regardless of attributes. It's like /A in most other commands, but in COPY /A copies files in ASCII mode -- i.e. mangles them.
 
Code:
copy /?
Copy data between disks, directories, files, or physical devices.

COPY [/A:[[-][+]rhsdaecjot] /CDEFGH /FTP:A /I"text" /JKLM /MD /N[dejnst] /O:[-]adegnrstu /OPQR /Sn /TU /V[n] WXZ] source [+] ... [/A /B] [TO:] destination [...] [/A /B]
        /A:(ttribute select)    /MD (make directory)
        /A(SCII)                /N(othing)
        /B(inary)               /O (not exist)
        /C(hanged)              /P(rompt)
        /D(ecrypt)              /Q(uiet)
        /E (no error messages)  /R(eplace)
        /F (no empty dirs)      /S(ubdirectories)
        /G (percent copied)     /T(otals)
        /H(idden)               /U(pdate)
        /I (match descriptions) /V(erify)
        /J (restartable)        /W (synchronize)
        /K(eep attributes)      /X (clear archive)
        /L (Symbolic links)     /Z (overwrite)
        /M(odified)
        /FTP:A FTP ASCII copy
 

Similar threads

Back
Top