Command to add registry entry

  • Thread starter Thread starter Jasper Recto
  • Start date Start date
J

Jasper Recto

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
 
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
 
John Wunderlich said:
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
 
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
 
Back
Top