Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to set a registry value with a command line without using a .reg file to import it?

I've looked over the reg and regedit.exe command line options, and it doesn't look like there's a way to do something like this...

reg update [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup]
share|improve this question
up vote 4 down vote accepted
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup" /v SourcePath /t REG_SZ /d "X:\\"

Add /f if you want to skip prompting for a possible overwrite.

share|improve this answer
Thanks, guess I didn't look close enough at that value – Nixphoe Sep 3 '11 at 0:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.