script.bat copied, but won't run; runs locally though
I've created a K1000 bat script to make a couple of registry edits.
When I run it, the log says it runs successfully, but the registry does not get changed.
When I look on the target machine in the C:\ProgramData\Dell\KACE\scripts\xxx directory, I can see the script file has been copied. If I then run the script file from a command prompt on the target machine, it runs, and the registry gets changed. I'm logged into the target machine with the same credentials I'm using to run the K1000 script. Why isn't the script running from the K1000?
Thanks!
When I run it, the log says it runs successfully, but the registry does not get changed.
When I look on the target machine in the C:\ProgramData\Dell\KACE\scripts\xxx directory, I can see the script file has been copied. If I then run the script file from a command prompt on the target machine, it runs, and the registry gets changed. I'm logged into the target machine with the same credentials I'm using to run the K1000 script. Why isn't the script running from the K1000?
Thanks!
5 Comments
[ + ] Show comments
Answers (0)
Please log in to answer
Be the first to answer this question
====================
@echo off
echo Adding key > READ1.txt
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\ExcelDataAnalysisAddIn" /v "Version" /d "1" /t REG_SZ /f
echo Adding key data > READ2.txt
REM reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\ExcelDataAnalysisAddIn" /v "StubPath" /d "REG ADD \"HKEY_LOCAL_MACHINE\Software\Microsoft\Office\16.0\Excel\Options\" /v Open /t REG_SZ /d \"/R \"C:\Program Files\Microsoft Office\Office16\Library\Analysis\ANALYS32.XLL\"\""
echo All done > READ3.txt
====================
and I see the READx.txt files show up, with the expected contents in them. So the script is running. Why isn't it changing the registry like it does if I run the script locally? - kentwest 7 years ago
====================
echo %USERNAME% > READ1.txt
====================
and re-ran the script. Ah, perhaps a clue!
C:\ProgramData\Dell\KACE\scripts\665>type READ1.txt
tech1
C:\ProgramData\Dell\KACE\scripts\665>whoami
win10clean\tech1
So I changed my credentials in the K1000 to be ".\tech1" instead of just "tech1", but it made no difference. - kentwest 7 years ago