/build/static/layout/Breadcrumb_cap_w.png

K1000 - .bat script running locally fine, but not when pushed through Kace

Hi all,

I have a simple .bat script that changes a registry value, that works great when running manually:


@Echo Off
cd %systemroot%\system32

Reg.exe add "HKCU\Control Panel\Desktop" /v "LogPixels" /t REG_DWORD /d "96" /f


However, when I push this through Kace, it is showing as complete, but no change actually happens in the registry.

I've tried switching the account to run as.. from "local system" to my own domain admin account, but still not pushing correctly through Kace. I am able to run the script fine by double-clicking it on the machines, or running as my domain admin account.

The script just changes the DPI settings in Windows to 100%, as we have some machines that are joined to the domain, but logged into a local account.. so they are not able to get this setting from GP.

Any ideas?

0 Comments   [ + ] Show comments

Answers (1)

Answer Summary:
Posted by: rad33k 7 years ago
Fourth Degree Brown Belt
3

Top Answer

That's because HKCU changes are made for the account / user who executed this script. In your case it was 'Local system' or domain admin. For the Local System changes were made under HKU\S-1-5-18\ as this is the SYSTEM's HKCU. The same was for the script started by the domain admin account - it has changed HKCU for this domain admin, not for the currently logged on user.
To run your script for the currently logged on user you may consider:
ActiveSetup
RunAsCurrentUser
NTUSER.DAT *

*This is for the professionals who knows what is the execution context :) (personally I do not like this method).

Comments:
  • AH!! Thank you very much. That makes perfect sense. Haha. I even called Quest to see if they had an answer and they are still "looking into this".

    I'll try this first thing tomorrow, but I don't see why it wouldn't work.

    I just needed a second pair of eyes to reiterate "CURRENT USER" to me. :) - feeldamped 7 years ago
    • You are welcome ;) Sometimes the "Rubber duck debugging" is very helpful ;-) - rad33k 7 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

View more:

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