使用参数在windows启动CMD上运行

使用参数在windows启动CMD上运行,windows,cmd,registry,Windows,Cmd,Registry,我需要在windows启动时使用参数运行cmd。是否可以通过注册表项执行此操作 我正在努力: "parameter"="\"C:\\Windows\\System32\\cmd.exe\"" [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\parameter] 但如果可能的话,我怎么能给它添加参数呢 我做了这个简单的任务C:\Windows\

我需要在windows启动时使用参数运行
cmd
。是否可以通过注册表项执行此操作

我正在努力:

"parameter"="\"C:\\Windows\\System32\\cmd.exe\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\parameter]
但如果可能的话,我怎么能给它添加参数呢

我做了这个简单的任务
C:\Windows\System32\cmd.exe/C notepad.exe
,但它不起作用。原因可能是什么

我会错过什么吗?我录了两张唱片

HKLM / RUN/ "C:\Windows\System32\cmd.exe /c notepad.exe"
HKEY_CURRENT_USER/ RUN "C:\Windows\System32\cmd.exe /c notepad.exe"
`


该命令不会启动记事本。

您的示例中,
*.reg
文件的行顺序错误。以下方面应起作用:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]
"Terminal"="C:\\Windows\\system32\\cmd.exe /c parameter1 parameter2 parameter3 ..."
这将仅在启动时运行一次。如果要在每次登录时运行,则需要将其更改为:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"Terminal"="C:\\Windows\\system32\\cmd.exe /c parameter1 parameter2 parameter3 ..."

从CMD你可以运行这个

REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce/t REG_SZ/d“”


或者,您可以手动转到此结构并输入字符串值,或者您可以在“开始”菜单中向“启动”文件夹添加快捷方式。如果在“启动”文件夹中使用命令行添加快捷方式,则会do@Phylogenesis非常感谢您的评论。只是我不知道如何通过注册表键进行操作。@user1627167你知道如何通过注册表进行操作吗?我做了一个简单的任务“C:\Windows\System32\cmd.exe/C notepad.exe”,但没有通过cmd运行记事本。原因是什么?HKLM配置单元中的Run/RunOnce键是在计算机启动时(在登录过程之前)运行的。如果您希望HKCU配置单元具有用户交互功能,则需要在HKCU配置单元中使用等效的键。我是否遗漏了什么?我在HKEY\ U CURRENT\ U USER/运行相同的记录“C:\Windows\System32\cmd.exe/C notepad.exe”时,在HKLM/RUN/“C:\Windows\System32\cmd.exe/C notepad.exe”中做了两条记录1,但cmd没有启动记事本