Run the cmd file Before logon

changfoster036

New Member
Messages
29
Reaction score
0
I need to use diskpart script to expand the partition;It needs to be run by administrator;
My file resize.cmd, how should I add it to ntlite;

Another question is, does the registry HKEY_CURRENT_USER already exist in the Before logon phase?
I need to import user.reg
 
1. Commands and scripts added to Post-Setup (Before logon) run under SYSTEM.
File / Add your batch file, and if you need to provide optional parameters, then copy them to the Parameters field.​
HKCU refers to the currently logged on user's profile, and that doesn't apply to you from (Before logon).​

2. Commands and scripts added to Post-Setup (After logon) run with Admin rights.
Because they're executed after you're logged on, HKCU now applies to your user profile. File / Add your reg file to have it applied to the primary user's account.​

3. If you need to apply reg changes for all new users, then you need to load Default User's NTUSER.DAT in (Before logon). Apply all reg changes relative to the hive's temporary mount point, and then unload the NTUSER.DAT.
Code:
reg load HKU\TEMP "%SystemDrive%\Users\Default\NTUSER.DAT"
reg add "HKU\TEMP\Control Panel\International" /v sDecimal /t REG_SZ /d "." /f
reg add "HKU\TEMP\Control Panel\International" /v sLongDate /t REG_SZ /d "yyyy-MM-dd" /f
reg add "HKU\TEMP\Control Panel\International" /v sShortDate /t REG_SZ /d "yyyy-MM-dd" /f
reg unload HKU\TEMP
 
Another question is, does the registry HKEY_CURRENT_USER already exist in the Before logon phase?
I need to import user.reg
Add reg file in NTLite (Integrate-Registry page) NTL integrates it very well ;)
I've been doing it for years
 
1. Commands and scripts added to Post-Setup (Before logon) run under SYSTEM.
File / Add your batch file, and if you need to provide optional parameters, then copy them to the Parameters field.​
HKCU refers to the currently logged on user's profile, and that doesn't apply to you from (Before logon).​

2. Commands and scripts added to Post-Setup (After logon) run with Admin rights.
Because they're executed after you're logged on, HKCU now applies to your user profile. File / Add your reg file to have it applied to the primary user's account.​

3. If you need to apply reg changes for all new users, then you need to load Default User's NTUSER.DAT in (Before logon). Apply all reg changes relative to the hive's temporary mount point, and then unload the NTUSER.DAT.
Code:
reg load HKU\TEMP "%SystemDrive%\Users\Default\NTUSER.DAT"
reg add "HKU\TEMP\Control Panel\International" /v sDecimal /t REG_SZ /d "." /f
reg add "HKU\TEMP\Control Panel\International" /v sLongDate /t REG_SZ /d "yyyy-MM-dd" /f
reg add "HKU\TEMP\Control Panel\International" /v sShortDate /t REG_SZ /d "yyyy-MM-dd" /f
reg unload HKU\TEMP
I also need to change HKEY_CLASSES_ROOT, is this method applicable?
 
HKEY_CLASSES_ROOT is the alias (name) for merged view of HKLM\Software\Classes and HKCU\Software\Classes at the same time.

Since there is a HKCU half of the HKR registry view, you need to pay attention to who is the current user. Otherwise you're applying changes to HKLM\Software\Classes (Machine), but to the wrong HKCU\Software\Classes (current user).

Move the HKR reg file to (After logon).
 
HKEY_CLASSES_ROOT is the alias (name) for merged view of HKLM\Software\Classes and HKCU\Software\Classes at the same time.

Since there is a HKCU half of the HKR registry view, you need to pay attention to who is the current user. Otherwise you're applying changes to HKLM\Software\Classes (Machine), but to the wrong HKCU\Software\Classes (current user).

Move the HKR reg file to (After logon).
Thanks garlin.
I have another question, in the "Post-Setup (Before logon)" stage, will executing "bcdedit /set loadoptions DISABLE_INTEGRITY_CHECKS" take effect immediately? I need to disable driver signature checking
 
Back
Top