Link to home
Start Free TrialLog in
Avatar of iNc0g
iNc0gFlag for Israel

asked on

Logon Script reg import key not working

Hello,

I've created a batch logon script under GPO > User configuration
the batch contains:
reg import "%logonserver%\netlogon\Train\LoginScripts\IeWindowReuse.reg"

the *.reg contains:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]
"AllowWindowReuse"=dword:00000000

When running the batch from a workstation (w/o admin rights)
I receive a msg that the Operation was completed Successfully but whem I look in the regedit I see the key hasn't been added.

If I manually run the *.reg file from the same location it does add it.

If I run another batch from the same workstation, same user:
reg import "%logonserver%\netlogon\train\LoginScripts\Keyboard_Heb_EN.reg"
*.reg:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Keyboard Layout]

[HKEY_CURRENT_USER\Keyboard Layout\IMEtoggle]

[HKEY_CURRENT_USER\Keyboard Layout\IMEtoggle\scancode]

[HKEY_CURRENT_USER\Keyboard Layout\Preload]
"1"="00000409"
"2"="0000040d"

[HKEY_CURRENT_USER\Keyboard Layout\Substitutes]
"d000040d"="00000409"

[HKEY_CURRENT_USER\Keyboard Layout\Toggle]
"Hotkey"="1"
"Language Hotkey"="1"
"Layout Hotkey"="2"

it works fine and I do not need to manually run the *.reg file.
Avatar of Bruno PACI
Bruno PACI
Flag of France image

Hi,

Did you verify that no any special not visible char is present in the reg file ?

Can you join the reg file as it is to this post ?


Have a good day
Avatar of iNc0g

ASKER

I wrote that when I manually run the regfile it works, only when I run the batch file (reg import command) it says it's successful but does not add the key to the registry.
Yes.... but when you run the regfile you implicitely use "REGEDIT" instead of REG.EXE.

That's why I wonder if some not visible char in the file could provocate a failure of REG.EXE. May be that REGEDIT is not sensitive to this bad char  !??

That's why I suggested you to post the REG file so that we could try by ourselves and reproduce the same problem.... It would not have take you a lot of time !
Avatar of iNc0g

ASKER

There you go :-)
IeWindowReuse.reg
A was a thread a couple of years ago, not exact but similar to this. You could read through it to see if anything helps: https://www.experts-exchange.com/questions/23237322/Batch-file-to-edit-registry.html
Avatar of iNc0g

ASKER

Still can't figure this out..

When running the batch to add a different key:


 with the same command
"reg import" it works.

Adding the:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]
"AllowWindowReuse"=dword:00000000

Does not.
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Keyboard Layout]

[HKEY_CURRENT_USER\Keyboard Layout\IMEtoggle]

[HKEY_CURRENT_USER\Keyboard Layout\IMEtoggle\scancode]

[HKEY_CURRENT_USER\Keyboard Layout\Preload]
"1"="00000409"
"2"="0000040d"

[HKEY_CURRENT_USER\Keyboard Layout\Substitutes]
"d000040d"="00000409"

[HKEY_CURRENT_USER\Keyboard Layout\Toggle]
"Hotkey"="1"
"Language Hotkey"="1"
"Layout Hotkey"="2"

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Steven Carnahan
Steven Carnahan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial