Solved

Logon Script reg import key not working

Posted on 2010-08-19
7
2,377 Views
Last Modified: 2012-06-27
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.
0
Comment
Question by:iNc0g
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 16

Expert Comment

by:Bruno PACI
ID: 33473087
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
0
 

Author Comment

by:iNc0g
ID: 33473328
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.
0
 
LVL 16

Expert Comment

by:Bruno PACI
ID: 33473593
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 !
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 

Author Comment

by:iNc0g
ID: 33474007
There you go :-)
IeWindowReuse.reg
0
 
LVL 26

Expert Comment

by:pony10us
ID: 33475691
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: http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Windows/XP/Q_23237322.html
0
 

Author Comment

by:iNc0g
ID: 33520175
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

0
 
LVL 26

Accepted Solution

by:
pony10us earned 500 total points
ID: 33568204
Just a thought but have you tried using regedit instead of reg import as shown in this post taken from http://forums.devshed.com/windows-help-34/windows-startup-scripts-99970.html?

PartieHonteuse  

Contributing User
   Join Date: Apr 2003
Location: Kzoo, Michigan
Posts: 37  
Time spent in forums: < 1 sec
Reputation Power: 8
   
 
Well the way I have found is to make a batch file to call regedit and have regedit insert a registry entry into the registry. Something like so...


--start startup.bat--

@echo off
cls
REGEDIT /S regtweak.reg
goto EOF
:EOF

--end startup.bat--



--start regtweak.reg--

REGEDIT4

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

--end regtweak.reg--

**Notes**
dword:00000000 = New Window
dword:00000001 = existing window
Also, regtweak.reg and startup.bat have to be in the same directory for it to work or else at the REGEDIT /S line you will have to enter the path to the registry script if in a different directory than the batch file.

I'm only assuming that you are running a domain so you can create a GPO and link it to that logon script for all 400 pc's.

Good luck!
__________________
"I dislike duals. If a man were to challenege me to a dual, i'd lead him lovingly and forgivingly to a quiet place, and kill him" ~Mark Twain

--------------------------------------------------------------------------------
 
 
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
This article describes my battle tested process for setting up delegation. I use this process anywhere that I need to setup delegation. In the article I will show how it applies to Active Directory
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question