0
0
I've created a two line batch that checks for the existence of a file and if it exists, imports a reg key with the correct setting values. It needs to work with Windows 7 (32 & 64-bit) as well as Windows XP 32-bit. This is being assigned as a logon script via GPO.
IF EXIST "%programfiles(x86)%\path_to_file\file.exe" REG IMPORT "path_to_reg\file.reg"
IF EXIST "%programfiles%\path_to_file\file.exe" REG IMPORT "path_to_reg\file.reg"
This works flawlessly with Windows 7. However, I am also trying to use it for clients using Windows XP and it is there that I am having difficulty. If I run the batch from the logged in user's command-line in Windows XP it works and the values are imported. It simply does not add the values when run at logon in Windows XP. I should also add that I have tried this using both regedit.exe /s and reg import.
How exactly did you assign it as a logon script? – Ƭᴇcʜιᴇ007 – 2013-08-12T16:00:28.510
via Group Policy – Matt P – 2013-08-12T16:04:07.670
That's not very exact. ;) Basically, are you sure you added it as a logon script and not a startup script? Anything reported regarding failed GP execution in the Event Logs or Rsop.msc? Also, where is the /reg file to import being kept? – Ƭᴇcʜιᴇ007 – 2013-08-12T16:08:59.670
I'm sorry, it is assigned as a logonscript and not a startup script. No failure messages in event logs or userenv debug logs. The reg file to be imported is kept in shared directory along side the script. And just to reiterate, it works flawlessly in Win7. Win XP seems to either some of the reg values or does not apply them at all. – Matt P – 2013-08-12T16:19:21.587
Have you confirmed if the script is running at all? You need to determine if the script is failing to run, or if the reg import itself is failing. To me, it seems more the like the script just isn't running at all. Does RSOP or GPResult confirm the policy/script is assigned as expected? – Ƭᴇcʜιᴇ007 – 2013-08-12T16:21:34.590
RSOP.msc confirms it is being correctly applied. Last executed time matches last logon. – Matt P – 2013-08-12T16:27:00.357
Going through with a fine-toothed comb, it appears that the script is applying the reg but not all of the values are taking effect. In particular, the last value in the reg. Is it possible that this is happening because the key does not exist before the value is set via the reg import? – Matt P – 2013-08-12T18:13:13.223