如何通过执行批处理文件CMD命令 [英] how to execute cmd commands through batch file

查看:193
本文介绍了如何通过执行批处理文件CMD命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想编写一个批处理文件,将做以下的事情在给定的顺序 -

I want to write a batch file that will do following things in given order-


  1. 开启CMD

  2. 运行cmd命令 CD C:\\ Program Files文件\\ IIS防爆preSS

  3. 运行cmd命令 iisex preSS /path:\"C:\\FormsAdmin.Site/端口:8088 /clr:v2.0

  4. 开启IE8与URL = 的http://本地主机:8088 / Default.aspx的

  1. open cmd
  2. run cmd command cd c:\Program files\IIS Express
  3. run cmd command iisexpress /path:"C:\FormsAdmin.Site" /port:8088 /clr:v2.0
  4. open IE8 with URL= http://localhost:8088/default.aspx

注:cmd窗口不应该执行这些命令后关闭

Note: cmd window should not be closed after executing the commands.

我试过开始的cmd.exe / KCD \\&放大器; CD PROGRAMFILES \\ IIS防爆preSS,但它不解决我的目的。

I tried start cmd.exe /k "cd\ & cd ProgramFiles\IIS Express" but it is not solving my purpose.

推荐答案

所以,让一个实际的批处理文件:打开记事本,输入要运行的命令,并保存为蝙蝠文件。然后双击.bat文件来运行它。

So, make an actual batch file: open up notepad, type the commands you want to run, and save as a .bat file. Then double click the .bat file to run it.

尝试是这样的一个启动:

Try something like this for a start:

c:\
cd c:\Program files\IIS Express
start iisexpress /path:"C:\FormsAdmin.Site" /port:8088 /clr:v2.0
start http://localhost:8088/default.aspx
pause

这篇关于如何通过执行批处理文件CMD命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆