Replacing registry default value from command line

How can I correctly replace this information

REG Add "HKEY_CURRENT_USER\SOFTWARE\Classes\.jpg" /f /v "(Default)" /t REG_SZ /d "PhotoViewer.FileAssoc.Tiff"

Use the /ve option (Set the (default) value) instead of /v:

REG Add "HKEY_CURRENT_USER\SOFTWARE\Classes\.jpg" /ve /d "PhotoViewer.FileAssoc.Tiff" /f

Syntax

REG ADD [ROOT\]RegKey /ve [/d Data] [/f] -- Set the (default) value

Source reg


Further Reading

  • An A-Z Index of the Windows CMD command line - An excellent reference for all things Windows cmd line related.
  • reg - Read, Set or Delete registry keys and values, save and restore from a .REG file.

Try using /ve instead of /v like this: REG Add "HKEY_CURRENT_USER\SOFTWARE\Classes\.jpg" /f /ve /d "PhotoViewer.FileAssoc.Tiff"