简体   繁体   中英

Copying User Profile to Default Profile in Windows 7

I'm trying to find a way using, hopefully, a batch file to copy a modified user profile to the default user profile so that any user that logs in to the computer will adopt the profile setup. We're using a utility called pGina to call the default profile for a user logged in through a RADIUS server, as opposed to having the user log in to the domain directly. Currently, we're trying to use robocopy for this.

cd C:\Users\
rmdir Default /s /q
robocopy /COPY:DAT /R:5 /E C:\Users\user1 C:\Users\Default
pause

Does anyone have any idea how to successfully copy the profile? Thanks in advance.

This is what I found when searching for an answer to your problem

rem delete old Default User profile
RD /s /q "%systemdrive%\Profiles\Default User"

rem copy current user profile to default user profile
xcopy "%USERPROFILE%\*.*" "%systemdrive%\Profiles\Default User" /e /c /I /H /R /K /Y 
rem delete non-need some files 
del /f /q "%systemdrive%\Profiles\Default User\*.*" 
rem set default attributes
attrib +h "%systemdrive%\Profiles\Default User"

rem registry trick
rem no directly copy locked ntuser.dat file
rem use reg tools to save current user registry to file
reg save HKCU "%systemdrive%\Profiles\Default User\ntuser.dat"
rem set default attributes to hive file  
attrib +H +S "%systemdrive%\Profiles\Default User\ntuser.dat"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM