Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > Command to add registry entry

Reply
Thread Tools Display Modes

Command to add registry entry

 
 
Jasper Recto
Guest
Posts: n/a

 
      03-25-2009
I would like to add a registry entry into every users HKCU registry. Is
that possible to do from a batch file?


If so, what commands do I need to use? I need to add this registry key:

HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\A ccess\Security\Trusted
Locations

And then I need to create another key called Locations under that.
Then I need to add a string with a value for it.

Is this possible to do from a batch file?

Thanks,
Jasper


 
Reply With Quote
 
 
 
 
John John - MVP
Guest
Posts: n/a

 
      03-25-2009
Yes, absolutely. There are several ways that can be used. Start here:

How to add, modify, or delete registry subkeys and values by using a
registration entries (.reg) file
http://support.microsoft.com/kb/310516

Distributing Registry Changes
http://technet.microsoft.com/en-us/l.../bb727154.aspx

John

Jasper Recto wrote:
> I would like to add a registry entry into every users HKCU registry. Is
> that possible to do from a batch file?
>
>
> If so, what commands do I need to use? I need to add this registry key:
>
> HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\A ccess\Security\Trusted
> Locations
>
> And then I need to create another key called Locations under that.
> Then I need to add a string with a value for it.
>
> Is this possible to do from a batch file?
>
> Thanks,
> Jasper
>
>

 
Reply With Quote
 
John Wunderlich
Guest
Posts: n/a

 
      03-25-2009
"Jasper Recto" <> wrote in
news::

> I would like to add a registry entry into every users HKCU
> registry. Is that possible to do from a batch file?
>
>
> If so, what commands do I need to use? I need to add this
> registry key:
>
> HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\A ccess\Security\Tr
> usted Locations
>
> And then I need to create another key called Locations under that.
> Then I need to add a string with a value for it.
>
> Is this possible to do from a batch file?
>
> Thanks,
> Jasper
>
>


You can do this using the 'reg' command:

reg add "HKCU\Software\Microsoft\Office\12.0\Access\Securi ty\Trusted Locations"
reg add "HKCU\Software\Microsoft\Office\12.0\Access\Securi ty\Trusted Locations\Locations"
reg add /v string "HKCU\ ... \Locations" /t REG_MULTI_SZ /d dataHere

where, of course, "..." contains the rest of the path.

HTH,
John
 
Reply With Quote
 
Al Dunbar
Guest
Posts: n/a

 
      03-25-2009

"John Wunderlich" <> wrote in message
news:Xns9BD983B9914Dwunderpsdrscray@138.126.254.21 0...
> "Jasper Recto" <> wrote in
> news::
>
>> I would like to add a registry entry into every users HKCU
>> registry. Is that possible to do from a batch file?
>>
>>
>> If so, what commands do I need to use? I need to add this
>> registry key:
>>
>> HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\A ccess\Security\Tr
>> usted Locations
>>
>> And then I need to create another key called Locations under that.
>> Then I need to add a string with a value for it.
>>
>> Is this possible to do from a batch file?
>>
>> Thanks,
>> Jasper
>>
>>

>
> You can do this using the 'reg' command:
>
> reg add "HKCU\Software\Microsoft\Office\12.0\Access\Securi ty\Trusted
> Locations"
> reg add "HKCU\Software\Microsoft\Office\12.0\Access\Securi ty\Trusted
> Locations\Locations"
> reg add /v string "HKCU\ ... \Locations" /t REG_MULTI_SZ /d dataHere
>
> where, of course, "..." contains the rest of the path.


That works for the currently logged on user, but the OP wanted to do this to
"every users HKCU registry" - that doesn't sound like he wants each of them
to do it for themselves.

/Al


 
Reply With Quote
 
John Wunderlich
Guest
Posts: n/a

 
      03-26-2009
"Al Dunbar" <> wrote in
news::

>
> "John Wunderlich" <> wrote in message
> news:Xns9BD983B9914Dwunderpsdrscray@138.126.254.21 0...
>> "Jasper Recto" <> wrote in
>> news::
>>
>>> I would like to add a registry entry into every users HKCU
>>> registry. Is that possible to do from a batch file?
>>>
>>>
>>> If so, what commands do I need to use? I need to add this
>>> registry key:
>>>
>>> HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\A ccess\Security\
>>> Tr usted Locations
>>>
>>> And then I need to create another key called Locations under
>>> that. Then I need to add a string with a value for it.
>>>
>>> Is this possible to do from a batch file?
>>>
>>> Thanks,
>>> Jasper
>>>
>>>

>>
>> You can do this using the 'reg' command:
>>
>> reg add
>> "HKCU\Software\Microsoft\Office\12.0\Access\Securi ty\Trusted Locations" reg add
>> "HKCU\Software\Microsoft\Office\12.0\Access\Securi ty\Trusted Locations\Locations" reg add /v string "HKCU\ ... \Locations" /t
>> REG_MULTI_SZ /d dataHere
>>
>> where, of course, "..." contains the rest of the path.

>
> That works for the currently logged on user, but the OP wanted to
> do this to "every users HKCU registry" - that doesn't sound like
> he wants each of them to do it for themselves.
>
> /Al


True... but if it's part of the login script, it will be
incorporated as each user logs in.

-- John
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
registry entry missing!!! Machdel Windows Vista General Discussion 4 01-22-2009 07:00 PM
Corrupt Registry Entry MsBunnie Internet Explorer 2 02-01-2008 09:25 PM
Re: registry entry for IsDomainMaster Russ \(SBITS.Biz\) Windows Small Business Server 3 01-05-2008 09:35 PM
Registry entry David Sherman Windows Small Business Server 8 05-19-2007 04:10 PM
registry entry explanation Samir Windows Vista Drivers 1 08-08-2003 09:05 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59