-
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid repeated loading and unloading of ‘C:\Users\Default\NTUSER.DAT’…
… hive
- Loading branch information
1 parent
5178e23
commit 7289c5b
Showing
10 changed files
with
122 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
namespace Schneegans.Unattend; | ||
|
||
class DefaultUserModifier(ModifierContext context) : Modifier(context) | ||
{ | ||
public override void Process() | ||
{ | ||
if (DefaultUserScript.IsEmpty) | ||
{ | ||
return; | ||
} | ||
CommandAppender appender = GetAppender(CommandConfig.Specialize); | ||
string script = DefaultUserScript.GetScript(); | ||
string ps1File = @"C:\Windows\Setup\Scripts\DefaultUser.ps1"; | ||
AddTextFile(script, ps1File); | ||
|
||
appender.Append(CommandBuilder.RegistryCommand(@"load ""HKU\DefaultUser"" ""C:\Users\Default\NTUSER.DAT""")); | ||
appender.Append(CommandBuilder.InvokePowerShellScript(ps1File)); | ||
appender.Append(CommandBuilder.RegistryCommand(@"unload ""HKU\DefaultUser""")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.