Problem with command "regedit /s" within a .CMD script

(imported topic written by jmlafreniere91)

Hello, I’m trying to deploy a script to some workstations and I can’t seem to make it work so maybe you can help.

I’m using the Windows Software Distribution Wizard to upload the content of a directory to the Bigfix server that contains the following:

branding.cmd

adjustments.reg

logo.bmp

The “branding.cmd” does the following:


if exist “%programfiles%\logo” goto logo

mkdir “%programfiles%\logo”

:logo

copy /y \\logo.bmp “%programfiles%\logo\logo.bmp”

regedit /s \\adjustments.reg


The registry key looks like the following (some lines were removed to shorten a bit):


Windows Registry Editor Version 5.00

HKEY_CURRENT_USER\Control Panel\Desktop

“ActiveWndTrkTimeout”=dword:00000000

“AutoEndTasks”=“0”

“CaretWidth”=dword:00000001

“CoolSwitch”=“1”

“CoolSwitchColumns”=“7”

“CoolSwitchRows”=“3”

“CursorBlinkRate”=“530”

“DragFullWindows”=“1”

“DragHeight”=“4”

“DragWidth”=“4”

“FontSmoothing”=“2”

“FontSmoothingOrientation”=dword:000000

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\General

“TileWallpaper”=“0”

“WallpaperStyle”=“2”

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced

“ListviewShadow”=dword:00000000

HKEY_CURRENT_USER\Control Panel\Colors

“Background”=“255 211 82”


I’m using a .CMD script to apply the reg keys because there are so many that I don’t want to add them one by one in a fixlet and until now, and I cannot make that work, nor the Windows Registry Wizard.

I’ve added some “pauses” to see what’s going on and, when removing the “/s” to the regedit command, I see the window that ask if I want to merge the registry, and even though it seems to work, IT WON’T DO ADD THE CHANGES in the registry.

Here’s what my action look like:

download http://bigfix.cogeco.com:52311/Uploads/3abbfb6b656306d83bb658585c3360e52597f6bd/Branding.tmp

continue if {(size of it = 701741 AND sha1 of it = “3abbfb6b656306d83bb658585c3360e52597f6bd”) of file “Branding.tmp” of folder “__Download”}

extract Branding.tmp

wait __Download\brandingfr.cmd

What could be wrong ? I’m starting to think that I’m a complete dumba$$ but up to now creating Bigfix scripts is not that straightforward.

UPDATE:

I’ve found that the change is applied to HKEY_USERS.DEFAULT instead of HKEY_CURRENT_USER. Maybe this information can help me troubleshooting my issue.

SECOND UPDATE:

I’ve also found out that there’s a checkbox called “Run as current user” when using the Windows Registry Wizard, but it says the user needs to have admin rights which is a non sense to me. I can’t find the same option using Windows Software Distribution Wizard.

Thanks,

Jim

(imported comment written by jmlafreniere91)

I made it work, but in a “unfashioned” way.

I’m using multiple “regset” to change the wanted registry keys and I’m wondering if I can use an “append” command or if I can change multiple values under a specific key without putting the whole string in the front. Here’s my example:

regset “” “ActiveWndTrkTimeout”=dword:00000000

regset “” “AutoEndTasks”=“0”

regset “” “CaretWidth”=dword:00000001

I tried this and it doesn’t work:

regset “” “ActiveWndTrkTimeout”=dword:00000000 “AutoEndTasks”=“0” “CaretWidth”=dword:00000001

OR

regset “”

“ActiveWndTrkTimeout”=dword:00000000

“AutoEndTasks”=“0”

“CaretWidth”=dword:00000001

I don’t want to use “Windows Registry Wizard”. This is the only way I could make registry changes to the current logged on user.

Regards,

Jim