Solved

Logon Script reg import key not working

Posted on 2010-08-19
7
2,358 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
  • 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
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Event ID 1054 Userenv 2 33
Batch: reboot servers one by one. 4 23
Replication problems 6 23
Repadmin - Active Directly synchronization 13 19
In this article, we will see the basic design consideration while designing a Multi-tenant web application in a simple manner. Though, many frameworks are available in the market to develop a multi - tenant application, but do they provide data, cod…
This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

829 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