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:
Please log in to answer
Posted by:
rad33k
7 years ago
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).
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