For some reason I need to run CMD on windows startup. I need to run CMD with arguments. Is it possible to do via registry key?
I am trying the
"parameter"="\"C:\\Windows\\System32\\cmd.exe\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\parameter]
But how can I add arguememnts to it, if that's possible?
I made this simple task "C:\Windows\System32\cmd.exe /c notepad.exe" But dont have notepad to be run by cmd. What can be the reson?
Can I be missing something? I have made two records 1 in HKLM / RUN/ "C:\Windows\System32\cmd.exe /c notepad.exe" 2 in HKEY_CURRENT_USER/ RUN the same record "C:\Windows\System32\cmd.exe /c notepad.exe"
But the cmd doesnt start notepad
Your example has the lines in the wrong order for a
*.reg
file. The following should work:This will only run once on bootup. If you want to run every time you log in, then you need to change it to:
from CMD you can Run this
REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /t REG_SZ /d " "
or manually you can go to this structure and string value