使用参数在Windows启动CMD上运行 [英] Run on windows startup CMD with arguments
问题描述
由于某种原因,我需要在Windows启动时运行CMD。我需要使用参数运行CMD。
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?
我正在尝试
"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?
我做了这个简单的任务 C:\Windows\System32\cmd.exe / c notepad.exe,但是没有记事本由cmd运行。什么是共鸣?
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?
我能缺少什么吗?我在HKLM / RUN /中创建了两个记录 1,在HKEY_CURRENT_USER中创建了
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
推荐答案
您的示例中 *。reg
文件的行顺序错误。以下应该可以工作:
Your example has the lines in the wrong order for a *.reg
file. The following should work:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]
"Terminal"="C:\\Windows\\system32\\cmd.exe /c parameter1 parameter2 parameter3 ..."
这将仅在启动时运行一次。如果要在每次登录时运行,则需要将其更改为:
This will only run once on bootup. If you want to run every time you log in, then you need to change it to:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"Terminal"="C:\\Windows\\system32\\cmd.exe /c parameter1 parameter2 parameter3 ..."
这篇关于使用参数在Windows启动CMD上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!