Jump to content


  • 0
roshanbhavsar04

How can I change a HKCU setting within Windows during an OSD deployment

Question

Recommended Posts

  • 0

some updates on developments

 

Reg ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" /V VisualFXSetting /T REG_DWORD /F /D 2 - these are the content from batch file and it works well but I need to run it using a vbscript silently -

 

I tried it using -

 

set wshell = CreateObject("WScript.Shell")
wshell.run “PCVIS.bat"
set wshell = nothing

 

but its not working :(

Share this post


Link to post
Share on other sites

  • 0

you are trying to apply settings to the Current User section of the registry which won't work during a task sequence as the task sequence runs for Computers not users,

you can get around this by mounting the registry hive for the Default User, making the changes using your chosen registry file which is pointing to this mount point, then commit the changes,

 

what this will mean is that All new user profiles on that computer will get the change, here's an example of that for a Windows 7 deployment (you will need to adjust accordingly for Windows XP so that C:\Users becomes C:\Documents and Settings\)

 

Below is an example for modifying HKCU settings for Windows 7

 

the first step will Load the Default User registry hive into a mountpoint called Defuser using a Run Command Line step like so

cmd.exe /c reg.exe load HKEY_LOCAL_MACHINE\defuser c:\users\default\ntuser.dat
 

in the next step we import the Registry file in another Run Command Line step this Registry file can be a file in a package.

cmd.exe /c reg.exe import "Userprefs.reg"
 

the important thing here is that the registry file refers to the mountpoint referenced in our first step, below is an example of that

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MediaPlayer\Preferences]
"AcceptedEULA"=dword:00000001
"FirstTime"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer]
"GroupPrivacyAcceptance"=dword:00000001

;Change start Page to windows-noob
[HKEY_LOCAL_MACHINE\defuser\Software\Microsoft\Internet Explorer\Main]
"Start Page"="http://www.windows-noob.com"
"Default_Page_URL"="http://www.windows-noob.com"

;Add documents on desktop add My computer 
[HKEY_LOCAL_MACHINE\defuser\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel]
"{20D04FE0-3AEA-1069-A2D8-08002B30309D}"=dword:00000000
"{59031a47-3f72-44a7-89c5-5595fe6b30ee}"=dword:00000000
"{871C5380-42A0-1069-A2EA-08002B30309D}"=dword:00000000

;Adds recent docs on startmenu
[HKEY_LOCAL_MACHINE\defuser\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"Start_ShowRecentDocs"=dword:00000001

;Intellimenus
[HKEY_LOCAL_MACHINE\defuser\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"Intellimenus"=dword:00000001

; Remove Accept Eula for Adobe reader 
[HKEY_LOCAL_MACHINE\defuser\SOFTWARE\Adobe\Acrobat Reader\9.0\AdobeViewer]
"EULA"=dword:00000001
"Launched"=dword:00000001

; Remove Accept Eula for Adobe svg reader 
[HKEY_LOCAL_MACHINE\defuser\SOFTWARE\Adobe\Adobe SVG Viewer\3.03\EULA]
"3.03x94"="accepted"

;set blank screensaver with a ten minute timeout
[HKEY_LOCAL_MACHINE\defuser\Control Panel\Desktop]
"ScreenSaveActive"="1"
"SCRNSAVE.EXE"="C:\\Windows\\system32\\scrnsave.scr"
"ScreenSaveTimeOut"="600"
"ScreenSaverIsSecure"="1"

;Show extension for files
[HKEY_LOCAL_MACHINE\defuser\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"HideFileExt"=dword:00000000
"SuperHidden"=dword:00000001

[HKEY_LOCAL_MACHINE\defuser\Software\Microsoft\Communicator]
"AutoRunWhenLogonToWindows"=dword:00000000
"FirstTimeUser"=dword:00000000
"TourPlayed"=dword:00000001

and finally we commit the changes in another Run Command Line step

cmd.exe /c reg.exe unload HKEY_LOCAL_MACHINE\defuser
 

and that's all there is to it, using this methodology you can set any HKCU keys you want to be applied during an OSD task sequence

cheers

niall

Share this post


Link to post
Share on other sites

  • 0

First thing, thanks a lot for your prompt response

 

Indeed, i wanted to change "adjust pc for best performance" for current user profile only and not for entire computer.

 

can you please let me know If I can program this registry file in package?

 

and what needs to be done in - cmd.exe /c reg.exe import "Userprefs.reg"

 

I didn't get this command line, means where and how should I use it??

 

Desktop.zip

Share this post


Link to post
Share on other sites

  • 0

userprefs.reg is just an example file name using the example registry file i posted above, simply replace the file name userprefs.reg with your OWN registry file,

 

you can create your own registry file by making the changes on your desired computer, and then exporting that registry key to a REG file.

 

Once you have the reg file edit it and replace all lines that begin with

 

[HKEY_CURRENT_USER\

 

with the following

 

[HKEY_LOCAL_MACHINE\Defuser\

 

below is an example of that.... I've created a Registry file in notepad called visualFXsetting.reg containing the following...

 

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\Defuser\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects]
"VisualFXSetting"=dword:00000002
 

save that file and in the following step, refer to the new registry file which is simply ONE file in a package

 

cmd.exe /c reg.exe import "visualFXsetting.reg"

 

like below...

 

hkcu import user preferences.png

 

as this question is frequently asked and misunderstood i've changed the Topic title to be more descriptive of the actual problem.


Share this post


Link to post
Share on other sites

  • 0

got it, I tried this command line in existing program but getting an error in execmgr

 

line - cmd.exe /c reg.exe import "pcvis.reg"

 

GetFileVersionInfoSize failed for file C:\WINDOWS\system32\CCM\Cache\TTG0028C.37.S-1-5-21-202387345-4201324245-3709672714-7083\cmd.exe, error 1812

Share this post


Link to post
Share on other sites

  • 0

Let me give you a brief idea on this. we have a 200 computers in a dept and got the requirement to change paging file size, 3 GB switch and adjust pc for best performance and I have created a package for it.

 

rest of the things are works perfect but only the thing is reg file works after importing to computer manually.

Share this post


Link to post
Share on other sites

  • 0

as per your suggestion I have edited export file and edited it.

 

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\Defuser\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects]
"VisualFXSetting"=dword:00000002

[HKEY_LOCAL_MACHINE\Defuser\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\AnimateMinMax]
"DefaultApplied"=dword:00000001

[HKEY_LOCAL_MACHINE\Defuser\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ComboBoxAnimation]
"DefaultApplied"=dword:00000001

[HKEY_LOCAL_MACHINE\Defuser\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\CursorShadow]
"DefaultApplied"=dword:00000001

[HKEY_LOCAL_MACHINE\Defuser\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DragFullWindows]
"DefaultApplied"=dword:00000001

[HKEY_LOCAL_MACHINE\Defuser\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DropShadow]
"DefaultValue"=dword:00000001
"DefaultApplied"=dword:00000001

[HKEY_LOCAL_MACHINE\Defuser\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\FontSmoothing]
"DefaultValue"=dword:00000001
"DefaultApplied"=dword:00000001

[HKEY_LOCAL_MACHINE\Defuser\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListBoxSmoothScrolling]
"DefaultApplied"=dword:00000001

[HKEY_LOCAL_MACHINE\Defuser\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewAlphaSelect]
"DefaultValue"=dword:00000001
"DefaultApplied"=dword:00000001

[HKEY_LOCAL_MACHINE\Defuser\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewShadow]
"DefaultValue"=dword:00000001
"DefaultApplied"=dword:00000001

[HKEY_LOCAL_MACHINE\Defuser\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewWatermark]
"DefaultValue"=dword:00000001
"DefaultApplied"=dword:00000001

[HKEY_LOCAL_MACHINE\Defuser\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\MenuAnimation]
"DefaultValue"=dword:00000001
"DefaultApplied"=dword:00000001

[HKEY_LOCAL_MACHINE\Defuser\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\SelectionFade]
"DefaultValue"=dword:00000001
"DefaultApplied"=dword:00000001

[HKEY_LOCAL_MACHINE\Defuser\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\TaskbarAnimations]
"DefaultValue"=dword:00000001
"DefaultApplied"=dword:00000001

[HKEY_LOCAL_MACHINE\Defuser\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\Themes]

[HKEY_LOCAL_MACHINE\Defuser\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\TooltipAnimation]
"DefaultValue"=dword:00000001
"DefaultApplied"=dword:00000001

[HKEY_LOCAL_MACHINE\Defuser\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\WebView]
"DefaultApplied"=dword:00000001

 

Share this post


Link to post
Share on other sites

  • 0

if you are sending a package to a computer then that is a different case altogether, is a user logged on ? yes/no

 

are you running the package as a user or as a computer, if running in system context (computer) then only the HKLM changes will apply (as in your case)

 

you need to run it in User Context or use the workaround i've explained already... (you can run it in user context by deploying it to a device collection, with an Available purpose, and set the program to run as the current logged on user)

 

have you tried doing this via a task sequence only (you can create a custom task sequence to do these steps...)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...



×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.