PC Review


Reply
Thread Tools Rate Thread

Command to add registry entry

 
 
Jasper Recto
Guest
Posts: n/a
 
      25th Mar 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\Access\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
 
      25th Mar 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\Access\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
 
      25th Mar 2009
"Jasper Recto" <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> 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\Access\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\Security\Trusted Locations"
reg add "HKCU\Software\Microsoft\Office\12.0\Access\Security\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
 
      26th Mar 2009

"John Wunderlich" <(E-Mail Removed)> wrote in message
news:Xns9BD983B9914Dwunderpsdrscray@138.126.254.210...
> "Jasper Recto" <(E-Mail Removed)> wrote in
> news:(E-Mail Removed):
>
>> 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\Access\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\Security\Trusted
> Locations"
> reg add "HKCU\Software\Microsoft\Office\12.0\Access\Security\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
 
      26th Mar 2009
"Al Dunbar" <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

>
> "John Wunderlich" <(E-Mail Removed)> wrote in message
> news:Xns9BD983B9914Dwunderpsdrscray@138.126.254.210...
>> "Jasper Recto" <(E-Mail Removed)> wrote in
>> news:(E-Mail Removed):
>>
>>> 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\Access\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\Security\Trusted Locations" reg add
>> "HKCU\Software\Microsoft\Office\12.0\Access\Security\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
Rate This Thread
Rate This Thread:

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
How to open CmdPrompt and write but NOT execute command to it ? Registry entry for cmd.exe history buffer? Ken Williams Windows XP Help 2 11th Oct 2005 07:52 PM
How to open CmdPrompt and write but NOT execute command to it ? Registry entry for cmd.exe history buffer? Ken Williams Windows XP General 1 11th Oct 2005 08:16 AM
How to open CmdPrompt and write but NOT execute command to it ? Registry entry for cmd.exe history buffer? Ken Williams Microsoft Windows 2000 1 11th Oct 2005 08:16 AM
Command line (or registry entry) to turn OFF/ON System Restore? KWW Windows XP General 4 9th Mar 2005 05:58 PM
Add a subkey entry to the registry from the command line? roman Windows XP General 3 10th May 2004 07:29 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:42 PM.