如何在Windows中为新用户帐户生成本地用户配置文件?

时间:2022-05-14 09:12:12

I have created a new local Windows account and want to modify some of the personal data for this new created profile. But if this account was never logged in, the profile data is not generated and so I cannot modify it. I want to modify things like the NTUSER.dat to customize the Current User Registry and prepare things in the user’s personal folder. I cannot use the default profile, because in my application it should be possible to create more than one local user account with different settings. And these Settings should not be used for the next new created user account.

我创建了一个新的本地Windows帐户,并希望修改这个新创建的配置文件的一些个人数据。但是,如果此帐户从未登录,则不会生成配置文件数据,因此我无法对其进行修改。我想修改像NTUSER.dat这样的东西来自定义当前用户注册表并在用户的个人文件夹中准备东西。我无法使用默认配置文件,因为在我的应用程序中,应该可以创建多个具有不同设置的本地用户帐户。并且这些设置不应用于下一个新创建的用户帐户。

Is there a way to initiate this generation process for the user profile folder?

有没有办法为用户配置文件夹启动此生成过程?

If not, is there a good way to automatically logon this new created user, wait until the profile has been generated and then logoff?

如果没有,是否有一种自动登录这个新创建用户的好方法,等到生成配置文件然后注销?

The solution should be able to work under Windows 2000, Windows XP, Windows Vista and Windows 7.

该解决方案应该能够在Windows 2000,Windows XP,Windows Vista和Windows 7下运行。

(I am using .NET 3.5 / C#, but I am open to all kind of answers as well)

(我使用的是.NET 3.5 / C#,但我也对各种答案持开放态度)

1 个解决方案

#1


A friend could help me and found the answer. This doesn't work under Windows 2000, but it works fine for Windows XP and Windows Vista, I will test Windows 7 later, but I guess it should work.

朋友可以帮助我并找到答案。这在Windows 2000下不起作用,但它适用于Windows XP和Windows Vista,稍后我将测试Windows 7,但我想它应该可行。

http://support.microsoft.com/kb/196070/en-us

#1


A friend could help me and found the answer. This doesn't work under Windows 2000, but it works fine for Windows XP and Windows Vista, I will test Windows 7 later, but I guess it should work.

朋友可以帮助我并找到答案。这在Windows 2000下不起作用,但它适用于Windows XP和Windows Vista,稍后我将测试Windows 7,但我想它应该可行。

http://support.microsoft.com/kb/196070/en-us