reg add failing - REALLY need help

G

Guest

All I want to do is change this simple key. Thats all.. LOL

I thought using reg add would work the quickest, and I would work on other
methods later. However, its failing. It says "too many command line
paramters". Please help

reg add HKCU\Software\Microsoft\Windows\CurrtVersion\Internet Settings\Url
History /v DaysToKeep /t REG_DWORD /d 00000024
 
G

Galen

In tjcooper <[email protected]> had this to say:

My reply is at the bottom of your sent message:
All I want to do is change this simple key. Thats all.. LOL

I thought using reg add would work the quickest, and I would work on
other methods later. However, its failing. It says "too many command
line paramters". Please help

reg add HKCU\Software\Microsoft\Windows\CurrtVersion\Internet
Settings\Url History /v DaysToKeep /t REG_DWORD /d 00000024

I think this should do it:


Copy below this:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\Url History]
"DaysToKeep"=dword:00000018

Don't copy this...

Save it to a text document, rename it anything.reg or what ever, then right
click > merge...

It should work...

Galen
 
M

MikeVa [MSFT]

It looks like you have several spaces in the registry path.
"Internet Settings" and "Url History" for example.
You must enclose the entire registry path in double-quotes, otherwise the
reg.exe command will treat each whitespace as the beginning of a new
argument.

This should work...
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\Url History" /v DaysToKeep /t REG_DWORD /d 00000024

You might also want to add the /f argument at the end to force an overwrite
of the value if it is already defined.

--
MikeVa [MSFT]

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
 
G

Guest

Thank you. You are correct. I figured it out about 10 minutes after I posted
(after wrestling with it for 2 hours).

The double quotes work great. I will use this method until I have the time
to create a .adm file.

MikeVa said:
It looks like you have several spaces in the registry path.
"Internet Settings" and "Url History" for example.
You must enclose the entire registry path in double-quotes, otherwise the
reg.exe command will treat each whitespace as the beginning of a new
argument.

This should work...
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\Url History" /v DaysToKeep /t REG_DWORD /d 00000024

You might also want to add the /f argument at the end to force an overwrite
of the value if it is already defined.

--
MikeVa [MSFT]

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
--
Please do not send e-mail directly to this alias.
This alias is for newsgroup purposes only.
--
tjcooper said:
All I want to do is change this simple key. Thats all.. LOL

I thought using reg add would work the quickest, and I would work on other
methods later. However, its failing. It says "too many command line
paramters". Please help

reg add HKCU\Software\Microsoft\Windows\CurrtVersion\Internet Settings\Url
History /v DaysToKeep /t REG_DWORD /d 00000024
 
G

Guest

What is the best way to apply this at login?

If I use a GPO login, can I modify the HKCU remotely, or does the .bat file
have to be located on the local machine (vs. the server)?

How do I do the same thing via VBS?

MikeVa said:
It looks like you have several spaces in the registry path.
"Internet Settings" and "Url History" for example.
You must enclose the entire registry path in double-quotes, otherwise the
reg.exe command will treat each whitespace as the beginning of a new
argument.

This should work...
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\Url History" /v DaysToKeep /t REG_DWORD /d 00000024

You might also want to add the /f argument at the end to force an overwrite
of the value if it is already defined.

--
MikeVa [MSFT]

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
--
Please do not send e-mail directly to this alias.
This alias is for newsgroup purposes only.
--
tjcooper said:
All I want to do is change this simple key. Thats all.. LOL

I thought using reg add would work the quickest, and I would work on other
methods later. However, its failing. It says "too many command line
paramters". Please help

reg add HKCU\Software\Microsoft\Windows\CurrtVersion\Internet Settings\Url
History /v DaysToKeep /t REG_DWORD /d 00000024
 
M

MikeVa [MSFT]

Reg.exe will let you modify the registry of a remote machine.
You will need to have the necessary rights on the remote box of course.

Just add the \\RemoteMachine\ to the front of the registry path...

reg add
"\\RemoteMachine\HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\Url History" /v DaysToKeep /t REG_DWORD /d 00000024

--
MikeVa [MSFT]

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
--
Please do not send e-mail directly to this alias.
This alias is for newsgroup purposes only.
--
tjcooper said:
What is the best way to apply this at login?

If I use a GPO login, can I modify the HKCU remotely, or does the .bat file
have to be located on the local machine (vs. the server)?

How do I do the same thing via VBS?

MikeVa said:
It looks like you have several spaces in the registry path.
"Internet Settings" and "Url History" for example.
You must enclose the entire registry path in double-quotes, otherwise the
reg.exe command will treat each whitespace as the beginning of a new
argument.

This should work...
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\Url History" /v DaysToKeep /t REG_DWORD /d 00000024

You might also want to add the /f argument at the end to force an overwrite
of the value if it is already defined.

--
MikeVa [MSFT]

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
--
Please do not send e-mail directly to this alias.
This alias is for newsgroup purposes only.
--
tjcooper said:
All I want to do is change this simple key. Thats all.. LOL

I thought using reg add would work the quickest, and I would work on other
methods later. However, its failing. It says "too many command line
paramters". Please help

reg add HKCU\Software\Microsoft\Windows\CurrtVersion\Internet Settings\Url
History /v DaysToKeep /t REG_DWORD /d 00000024
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top