/build/static/layout/Breadcrumb_cap_w.png

Reg Add Reg Delete Regedit /s in cmd file not working in K1000 offline script

I have a cmd and reg files in an offline script that is unzipped form the dependency dir to a folder on each 32 and 64 bit workstation.

In the cmd file I reg query (works) and if it finds the key reg adds a value (does not work). I have then tried regedit /s file.reg also (does not work).

Please help.

small samples of what I have tried: 

REG ADD "HKLM\SOFTWARE\JavaSoft\Java Update\Policy" /v NotifyInstall /t REG_DWORD /d 0 /f

REG DELETE "HKLM\SOFTWARE\JavaSoft\Java Update\Policy" /v PromptAutoUpdateCheck /f

setlocal

 

set regpath0="HKLM\SOFTWARE\Policies\Adobe\Acrobat Reader\8.0"

reg query %regpath0% > nul

IF %errorlevel%==0 (

Echo 8.0 Found

REG ADD "HKLM\SOFTWARE\Policies\Adobe\Acrobat Reader\8.0\FeatureLockdown" /V "bUpdater" /t REG_DWORD /d 0 /f

)

or using regedit

"C:\Windows\regedit.exe" /s "C:\DSD\Installs\3rdPartyUpdatesOff\JavaAW7.reg"

setlocal

 

set regpath0="HKLM\SOFTWARE\Policies\Adobe\Acrobat Reader\8.0"

reg query %regpath0% > nul

IF %errorlevel%==0 (

Echo 8.0 Found

"C:\Windows\regedit.exe" /s "C:\DSD\Installs\3rdPartyUpdatesOff\AdobeR8.reg"

)

JavaAW7.reg

Windows Registry Editor Version 5.00

 

[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Update\Policy]

"EnableJavaUpdate"=dword:00000000

"EnableAutoUpdateCheck"=dword:00000000

"NotifyDownload"=dword:00000000

"NotifyInstall"=dword:00000000

"PromptAutoUpdateCheck"=-

 

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Update\Policy]

"EnableJavaUpdate"=dword:00000000

"EnableAutoUpdateCheck"=dword:00000000

"NotifyDownload"=dword:00000000

"NotifyInstall"=dword:00000000

"PromptAutoUpdateCheck"=-

 

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]

"Adobe Reader Speed Launcher"=-

"Adobe ARM"=-

 

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run]

"Adobe Reader Speed Launcher"=-

"Adobe ARM"=-

 


0 Comments   [ + ] Show comments

Answers (1)

Posted by: dugullett 10 years ago
Red Belt
0

Can you set your "verify" to check for the registry entry. Then on "remediation" either change the registry key, or run a batch file wth regedit /s AdobeR8.reg. Make sure to upload the .reg as a dependency.


Comments:
  • This sounds like a typical 32-bit/64-bit problem to me. The KACE agent is a 32-bit process, so when it invokes $(KACE_SYS_DIR)\cmd.exe, it's a 32-bit environment you get for the batch file. So all the REG commands that use HKLM\SOFTWARE only "see" the 32-bit registry, so they will really be working under HKLM\SOFTWARE\Wow6432Node. And all the RegEdit commands will be seeing only the 32-bit registry as well.

    The 32-bit/64-bit topic is too big to fully explain here. (I've begged KACE to do a KKE on it.) But here's the main trick: if you test for which bitness at the start of the batch file, you can have separate sections to handle 32-bit or 64-bit Windows. And, to force the batch file commands to work correctly in the 64-bit environment, run programs like REG.exe and REGEDT32.exe from C:\windows\sysnative, where the 64-bit programs appear to be, when you start from a 32-bit process. (Why did I say regedt32.exe instead of regedit.exe? Because there is no regedit.exe in sysnative!)

    Want to really understand this 32-bit/64-bit stuff? Here is the $10 eBook version of a fabulous 1-day course on the topic: http://csi-windows.com/ebooks/windows-64-bit . I think every packager should take the 1-day course.

    Or else KACE could give us a 64-bit KACE Agent for 64-bit Windows... :-) Sande - snissen 10 years ago

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ