0

For whatever reason, this:

reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\BeginSecond
/v begin-second /t REG_DWORD /f
/d "%HOMEDRIVE%\Documents and Settings\%USERNAME%\Desktop\bat script\begin-second"
  • Line feeds were added for readability, the command itself is one continuous line.

Produces the message "Invalid command-line parameters" when the program is run. The command before that adds the registry key "BeginSecond", so that's not the issue...

But, for some strange reason, this command worked perfectly fine before I booted up my Windows 2000 virtual machine today.

There is probably some super easy fix for this. Any help, please?

Ofir Luzon
  • 10,635
  • 3
  • 41
  • 52
VeeTHis
  • 25
  • 4
  • 3
    Are you sure that you want to add a `REG_DWORD` instead of a `REG_SZ` registry value? Also, the error could be caused by having insufficient security rights to write to the specified registry key. Writing to the `HKEY_LOCAL_MACHINE` registry key and any of its subkeys usually requires administrative rights. – 303 Jun 13 '17 at 23:22
  • 3
    Not the solution, but: why using `%HOMEDRIVE%\Documents and Settings\%USERNAME%` rather than `%HOMEDRIVE%%HOMEPATH%`? why not even use `%USERPROFILE%` instead? – aschipfl Jun 13 '17 at 23:30

0 Answers0