简体   繁体   English

批处理脚本后继续使用CMD命令

[英]Continue With CMD Commands After Batch Script

I am trying to write a batch script which, once complete, would allow the user to continue using the Windows command prompt as they normally would had no script been run. 我正在尝试编写一个批处理脚本,该脚本一旦完成,将允许用户继续使用Windows命令提示符,因为通常不会运行脚本。 Is this possible? 这可能吗? Thank you in advance for any help. 预先感谢您的任何帮助。

If you manually open CMD (the Command Prompt) and invoke the batch file by name, CMD will remain open for additional commands after the batch file completes. 如果您手动打开CMD(命令提示符)并按名称调用该批处理文件,则在批处理文件完成后,CMD将对其他命令保持打开状态。 You cannot do this by double-clicking on the batch file, but if you create a shortcut to the batch file that runs CMD.EXE with the /K switch, you will run the batch file and then leave CMD running for additional commands. 您无法通过双击批处理文件来执行此操作,但是如果使用/K开关创建了运行CMD.EXE的批处理文件的快捷方式 ,则将运行批处理文件,然后使CMD运行以运行其他命令。 See CMD at SS64 . 请参阅SS64上的CMD

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM