When I run e.g. ipconfig
using the Run command (windows key+R), once the program has executed it immediately closes the instance of the command line interface, is there any universal parameter I can add to:
当我跑步,例如ipconfig使用Run命令(windows key + R),程序执行后立即关闭命令行界面的实例,是否有我可以添加的通用参数:
ipconfig
nslookup
dir
- etc...
to ensure that the results stay printed in the console window?
确保结果保持打印在控制台窗口中?
3 个解决方案
#1
Use cmd
with the /k
switch:
将cmd与/ k开关一起使用:
cmd /k ipconfig
#2
There is also the ability to concatenate commands
还可以连接命令
& is used to just post multible commands in a line && will break if the last command wasn't successful
&用于在一行中发布多个命令&&将在最后一个命令不成功时中断
cmd /k ipconfig & pause & exit
#3
Or you just execute "cmd" via the Run command, which will open a DOS prompt.
If you type "ipconfig" there, the command prompt remains open.
或者您只需通过Run命令执行“cmd”,这将打开DOS提示符。如果在那里键入“ipconfig”,命令提示符将保持打开状态。
(ok, I admit: basically it's the same like "cmd /k ipconfig")
(好吧,我承认:基本上它和“cmd / k ipconfig”一样)
#1
Use cmd
with the /k
switch:
将cmd与/ k开关一起使用:
cmd /k ipconfig
#2
There is also the ability to concatenate commands
还可以连接命令
& is used to just post multible commands in a line && will break if the last command wasn't successful
&用于在一行中发布多个命令&&将在最后一个命令不成功时中断
cmd /k ipconfig & pause & exit
#3
Or you just execute "cmd" via the Run command, which will open a DOS prompt.
If you type "ipconfig" there, the command prompt remains open.
或者您只需通过Run命令执行“cmd”,这将打开DOS提示符。如果在那里键入“ipconfig”,命令提示符将保持打开状态。
(ok, I admit: basically it's the same like "cmd /k ipconfig")
(好吧,我承认:基本上它和“cmd / k ipconfig”一样)