Jump to content

Reg add command: Can someone tell me what's wrong with this please?


Recommended Posts

Posted

Hi,

 

Simple thing. I'm trying to run the following command to add a new registry key:

 

REG ADD HKEY_CURRENT_USER\Software\Location /v ValueName /t REG_DWORD /d "\\server\serverpath" /f

 

So I'm basically trying to add a REG_DWORD value with the data string of a server path.

 

Anyway, everytime I get the error: "Too many command line parameters"

 

but as far as I can see it conforms completely with the command format.

 

Can anyone see where I might be going wrong, because I can't?

 

Thanks

Posted
Hi,

 

Simple thing. I'm trying to run the following command to add a new registry key:

 

REG ADD HKEY_CURRENT_USER\Software\Location /v ValueName /t REG_DWORD /d "\\server\serverpath" /f

 

So I'm basically trying to add a REG_DWORD value with the data string of a server path.

 

Anyway, everytime I get the error: "Too many command line parameters"

 

but as far as I can see it conforms completely with the command format.

 

Can anyone see where I might be going wrong, because I can't?

 

Thanks

 

Do you have the exact line you're using? Obviously can change servernames etc, but kind of need to see the string :)

 

Steve

Posted (edited)

@basicchannel If you are trying to add a REG_DWORD then you have to specitfy a number in /d More likely that you want to add a REG_SZ value (String) if the data is a path to a server?

 

To check that out use Regedit to manually add the value you want in the registry and then use "REG QUERY HKEY_Local_User\Software\Location /ve" to show current values in that area of the registry and their name, type and data.

 

Regards

 

David Irwin

Edited by Ergo
  • Thanks 1
Posted

OK, I really should have been more specific, so sorry about that.

 

I'm trrying to add a value to HKCU\Software\Microsoft\Office\12.0\Outlook\Setup in the form of ImportPRF to specify a prf server path for setting up Outlook profiles automatically. I assumed it should be a REG_DWORD

Posted

REG ADD HKCU\Software\Microsoft\Office\12.0\Outlook\Setup /v ImportPRF /t REG_SZ /d "\\server\serverpath" /f

 

Should work. Even doing it as dword shouldn't give the error you got, unless you're copying an extra space in somewhere?

 

Steve

  • Thanks 1
Posted
REG ADD HKCU\Software\Microsoft\Office\12.0\Outlook\Setup /v ImportPRF /t REG_SZ /d "\\server\serverpath" /f

 

Should work. Even doing it as dword shouldn't give the error you got, unless you're copying an extra space in somewhere?

 

Steve

 

Well REG_SZ worked perfectly. Trying to add it as a REG_DWORD failed miserably with the 'Invalid command line parameter' error. Very strange

Posted
Trying to add it as a REG_DWORD failed miserably with the 'Invalid command line parameter' error.

REG_DWORD's are usually numbers. e.g.

 

reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t [color="#FF0000"]REG_DWORD[/color] /d [color="#FF0000"]1[/color] /f

Posted
Well REG_SZ worked perfectly. Trying to add it as a REG_DWORD failed miserably with the 'Invalid command line parameter' error. Very strange

 

Glad you got it sorted :)

 

David Irwin

Posted

I always say - there is no such thing as a stupid question, it's just that questions help point out the daft things we are trying to do! :)

 

Regards,

 

David Irwin

Posted
Well REG_SZ worked perfectly. Trying to add it as a REG_DWORD failed miserably with the 'Invalid command line parameter' error. Very strange

 

I was going to say it was supposed to be REG_SV but I wasn't sure and didn't want to look stupid...

 

:doh:

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...