Jump to content

Set registry AFTER successful logon


Recommended Posts

Forgive me if this has already been discussed previously, I'm not entirely sure what to search the forum for...

Over the past 12 to 18 months I've dabbled in automated/silent installs, both general software and Windows XP. For Windows I was using Windows Unattended CD Creator until I found limitations in the software and had to turn to MSFN's unattended guide, which was excellent!

I've completely automated my Windows install and managed to add some customisations into the bargain. GREAT!

Some of the cutomisations I'm doing to the registry don't 'take', i.e. they're over written. I'm pretty sure that they're being over written Explorer sets itself up on first login to a users profile. I've tried changing the regsitry entries in RunOnceEx.cmd, but Explorer configures itself after the RunOnceEx entries run.

How do I set a startup batchfile/script to change the registry entries to what I want them to be, I want it completely automated so I don't have to make any changes.

Cheers,

DB

Edited by DragonzBreath
Link to comment
Share on other sites


The recommended method for setting User profile settings is to do it during setup at the T-12 stage. This is when CMDLINES.TXT runs. You can import any HKCU settings at this time. Since there are no users on the system yet, they will be imported into the Default User profile, and therefore will apply to any new user that logs onto the system.

You can also go ahead and import your custom HKLM settings at this point.

See the HKEY_CURRENT_USER section on this page for more information.

Link to comment
Share on other sites

I did add the reg files to cmdlines.txt, but I had the same issue there. It's only stuff like desktop wallpaper, and screensaver and the likes, but I'd rather not have to do anything at all ya know! I'm pretty sure that they're being overwritten just after first logon when IE Personalisation runs and configures desktop settings etc... I'll run a couple more tests and report back here.

Thanks!

Link to comment
Share on other sites

Aright, I made the necessary changes to my CD, and I was right in what I initially said. Quoting from the timeline in the unattended guide, I'll add in what I think is happening and hopefully someone can help me work around it.

» Text-mode Setup

1. Loads Drivers
2. Copies files required for Setup to the Hard Disk
3. Copies the contents of your $OEM$ folders to the Hard Disk
4. Reboots the PC...

» GUI-mode Setup

1. DetachedProgram executes from winnt.sif at T-39 stage
2. Installs Devices
3. Installs Network
4. Installs Start Menu Items
5. Registers Components
6. svcpack.inf executes at T-13 minute stage
7. cmdlines.txt executes at T-12 minute stage [b]Imports registry changes here[/b]
8. SetupParams executes from winnt.sif at T-9 minute stage
9. Saves Settings
10. Deletes temporary files then reboots...

» First Logon

1. Windows logs you in [b][i]and loads personal settings[/i][/b] - Windows doesn't in fact load personal settings, as there aren't any yet.
2. Both GUIRunOnce from winnt.sif and RunOnceEX executes at the same time
[b]3. Windows "Personalizes Settings" for Themes, IE, OE etc etc (Over writing custom registry entries)[/b]
4. Desktop and Taskbar loads

The problem is, I have a few registry entries that are overwritten when Windows "Personalizes Settings".

1. The Security Centre reports that the Windows Firewall is disabled

2. The desktop wallpaper is set to Bliss.bmp, despite having changed the wallpaper to none

3. The screensaver is changed to the default logon.scr

Problem 1 and 2 is livable, I can deal with that. But problem 3 is more critical. I use JKDefrag I've set it as the screensaver for the logon screen, but it doesn't take for newly created users.

If someone can solve all three problems, that'd be great. But I'd be happy with some help solving the last one!

Cheers!

DB

EDIT: Figured out the firewall problem I think - That was a missing registry entry!

Edited by DragonzBreath
Link to comment
Share on other sites

I know for a fact that those settings aren't overwritten when Windows first creates the profile. That's the entire purpose of customizing the Default User profile. :)

Post your registry settings please. You need to make sure that you're putting your settings in HKEY_CURRENT_USER and not in HKEY_USERS\.DEFAULT. The latter is the settings for the logon screen.

We've been successfully using the CMDLINES.TXT method here at work for several years now.

The only way those settings would be overwritten is if there's a GPO in the domain that enforces certain settings (yep, the screensaver and wallpaper can be enforced from a GPO).

Link to comment
Share on other sites

Hey nmX.Memnoch,

Thanks, I really appreciate your help here! I'm a Help Desk tech for a large organisation that's not doing so well financially, many of the techniques I've been using here (I've been shown by the other staff) are old and time consuming, hence trying to automate everything. I'm aware that many Windows customisations can be done via GPo, but a) I don't have the knowledge to make the changes (yet), and b) we have a Sys Admin who'd get very upset if I started playing with his GPo!!!

That said, we don't actually enforce any desktop wallpapers, or screensavers.

Is there anyway to set DNS entries in the winnt.sif file? I've managed to turn on NETBIOS, but couldn't do DNS suffixes/appendages.

Anyway, here are the registry files you asked for...

HKCU.reg

Windows Registry Editor Version 5.00

;Disable Sticky Keys
[HKEY_CURRENT_USER\Control Panel\Accessibility\StickyKeys]
"Flags"="506"

;Disable Filter Keys
[HKEY_CURRENT_USER\Control Panel\Accessibility\Keyboard Response]
"Flags"="122"

;Disable Toggle Keys
[HKEY_CURRENT_USER\Control Panel\Accessibility\ToggleKeys]
"Flags"="58"

;Disable desktop cleanup wizard
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\CleanUpWiz]
"NoRun"=dword:00000001

;Enable Number Lock
[HKEY_CURRENT_USER\Control Panel\Keyboard]
"InitialKeyboardIndicators"="2"

;Show file extensions in Explorer
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"HideFileExt"=dword:00000000

;Enable Desktop Icons-My Computer-My Network Places-IE & Icon Order
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu]
"{450D8FBA-AD25-11D0-98A8-0800361B1103}"=dword:00000000
"{20D04FE0-3AEA-1069-A2D8-08002B30309D}"=dword:00000000
"{871C5380-42A0-1069-A2EA-08002B30309D}"=dword:00000000
"{208D2C60-3AEA-1069-A2D7-08002B30309D}"=dword:00000000
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel]
"{450D8FBA-AD25-11D0-98A8-0800361B1103}"=dword:00000000
"{20D04FE0-3AEA-1069-A2D8-08002B30309D}"=dword:00000000
"{871C5380-42A0-1069-A2EA-08002B30309D}"=dword:00000000
"{208D2C60-3AEA-1069-A2D7-08002B30309D}"=dword:00000000
[HKEY_CLASSES_ROOT\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}]
"SortOrderIndex"=dword:00000054

;JKDefrag as user screensaver & no wallpaper
[HKEY_CURRENT_USER\Control Panel\Desktop]
"SCRNSAVE.EXE"="JkDefragScreenSaver.scr"
"Wallpaper"=""

;JKDefrag alternate screensaver
[HKEY_CURRENT_USER\Control Panel\Screen Saver.JkDefrag]
"CommandLine"=""
"LastRun"="1187410772"
"HoursToWait"="0"
"AlternateScreenSaver"="ssstars.scr"

;Star Screensaver settings
[HKEY_CURRENT_USER\Control Panel\Screen Saver.Stars]
"Density"="200"
"WarpSpeed"="1"

;Disable Language Bar
[-HKEY_CLASSES_ROOT\CLSID\{540D8A8B-1C3F-4E32-8132-530F6A502090}]
@="Language bar"
"MenuTextPUI"="@%SystemRoot%\\System32\\msutb.dll,-325"
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoSaveSettings"=dword:00000000

HKLM.reg

Windows Registry Editor Version 5.00

;Auto logon for ergadm
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"DefaultUserName"="ergadm"
"AutoAdminLogon"="1"
"DefaultPassword"="ergmisntadmin"
"AutoLogonCount"=dword:00000002

;Classic Logon
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"LogonType"=dword:00000000

;Classic Control Panel
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer]
"ForceClassicControlPanel"=dword:00000001

;Create Source Path
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup]
"SourcePath"=-
"SourcePath"="C:\\"
"Installation Sources"=-
"Installation Sources"="C:\\"
"ServicePackSourcePath"=-
"ServicePackSourcePath"="C:\\"

;Disable Windows Tour
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Tour]
"RunCount"=dword:00000000

;Disable Windows Firewall & Monitoring
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile]
"FirewallOverride"=dword:00000001
"EnableFirewall"=dword:00000000
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Security Center]
"FirewallDisableNotify"=dword:00000001

;Disable Security Centre Antivirus Monitoring & Notifications
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Security Center]
"AntiVirusOverride"=dword:00000001
"AntiVirusDisableNotify"=dword:00000001

;Disable Automatic Updates Monitoring
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Security Center]
"UpdatesDisableNotify"=dword:00000001

;Disable Automatic Updates
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update]
"AUOptions"=dword:00000001

;Disable Simple File Sharing
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa]
"forceguest"=dword:00000000

;Enable RDP
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server]
"fDenyTSConnections"=dword:00000000

;JKDefrag as logon screensaver
[HKEY_USERS\.DEFAULT\Control Panel\Desktop]
"SCRNSAVE.EXE"="JkDefragScreenSaver.scr"

;JKDefrag alternate screensaver
[HKEY_USERS\.DEFAULT\Control Panel\Screen Saver.JkDefrag]
"CommandLine"=""
"LastRun"="1187410772"
"HoursToWait"="0"
"AlternateScreenSaver"="C:\\WINDOWS\\system32\\logon.scr"

And just for good measure, here is my cmdlines.txt and winnt.sif as well.

[COMMANDS]
"RunOnceEx.cmd"
"REGEDIT /S HKCU.reg"
"REGEDIT /S HKLM.reg"

[Data]
MsDosInitiated="0"
UnattendedInstall="Yes"

[Unattended]
UnattendMode=DefaultHide
FileSystem=*
OemSkipEula=Yes
OemPreinstall=Yes
Repartition=No
WaitForReboot="No"
DriverSigningPolicy="Ignore"
OemPnPDriversPath="Drivers\Broadcom_B57XX_v10.24d;Drivers\IntelPro100;Drivers\IntelPro1000;Drivers\symmpi;"
UnattendSwitch=Yes

[GuiUnattended]
OEMSkipRegional=1
OemSkipWelcome=1
AdminPassword="password"
AutoLogon=Yes
AutoLogonCount=2
TimeZone=225

[UserData]
FullName="Company"
OrgName="Company"
ComputerName="MachineName"
ProductKey=XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

[Identification]
JoinWorkgroup="Workgroup"

[Networking]
InstallDefaultComponents=No

[RegionalSettings]
Language=00000c09
LanguageGroup=10

[Components]
msnexplr=off
zonegames=off
msmsgs=off
OEAccess=off

[SetupParams]
UserExecute="WScript.exe %systemroot%\Accounts.js"

[Display]
BitsPerPel=32
Xresolution=1024
Yresolution=768
Vrefresh=60

[TapiLocation]
CountryCode=0061
AreaCode=08

[NetProtocols]
MS_TCPIP=params.MS_TCPIP

[NetAdapters]
Adapter1=params.Adapter1

[params.Adapter1]
InfID="*"

[params.MS_TCPIP]
AdapterSections=params.MS_TCPIP.Adapter1

[params.MS_TCPIP.Adapter1]
SpecificTo=Adapter1
DHCP=YES
WINS=no
NetBIOSOptions=1

Thanks,

DB

Link to comment
Share on other sites

[COMMANDS]
"RunOnceEx.cmd"
"REGEDIT /S HKCU.reg"
"REGEDIT /S HKLM.reg"

First, take the quotes off and give it a shot...like this:

[COMMANDS]
RunOnceEx.cmd
REGEDIT /S HKCU.reg
REGEDIT /S HKLM.reg

Let me know how that works. Other than that, and keep in mind I just looked at it real quick, I see no reason why the settings shouldn't be working.

Edited by nmX.Memnoch
Link to comment
Share on other sites

The thing is, the only things that do not take are:

1. The desktop wallpaper and

2. The screensaver

The rest of the registry changes actually work. Hence why I'm think it's the Personalized Settings changing them back. If I re-run the HKCU.reg file after the Personalized Settings have taken effect, it works.

Anyhow, I'll give it a go and I'll let you know how it turns out.

DB

Link to comment
Share on other sites

Hmmm...I'll have to double check that with mine tomorrow. Wait...actually, I know that the wallpaper sticks because we are setting a default one. But we're specifying a specific bitmap instead of removing it.

Have you tried completely removing the Wallpaper value? Change this:

"Wallpaper"=""

to this

"Wallpaper"=-

You may also want to try adding this

"PrevWallpaper"=-

As for the screensaver...I'm pretty sure you have to specify the full path to the .scr file. And you can't use system variables (i.e. you have to use C:\WINDOWS as opposed to %WINDIR% or %SYSTEMROOT%).

Link to comment
Share on other sites

Hmmm...I'll have to double check that with mine tomorrow. Wait...actually, I know that the wallpaper sticks because we are setting a default one. But we're specifying a specific bitmap instead of removing it.

Have you tried completely removing the Wallpaper value? Change this:

"Wallpaper"=""

to this

"Wallpaper"=-

You may also want to try adding this

"PrevWallpaper"=-

As for the screensaver...I'm pretty sure you have to specify the full path to the .scr file. And you can't use system variables (i.e. you have to use C:\WINDOWS as opposed to %WINDIR% or %SYSTEMROOT%).

Haven't tried deleting the wallpaper entry altogether yet, but I will.

And as for the screensaver, I added that same screensaver as the default for the logon screen in exactly the same way, it works perfectly. I'll try adding the full path though.

Ta

DB

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...