2012-08-15 178 views
0

我试图找到一种方法,使用希望的批处理文件将修改的用户配置文件复制到默认用户配置文件,以便任何登录到计算机的用户都将采用配置文件设置。我们使用名为pGina的实用程序来调用通过RADIUS服务器登录的用户的默认配置文件,而不是让用户直接登录到域。目前,我们正在尝试使用robocopy。在Windows 7中将用户配置文件复制到默认配置文件

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

有没有人有任何想法如何成功复制配置文件?提前致谢。

回答

1

这是寻找答案的时候我found您的问题

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"