How do I execute cmd commands through a batch file?

前端 未结 8 826
难免孤独
难免孤独 2020-12-02 07:37

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

  1. Open cmd
  2. Run cmd command cd c:\\Program files\\IIS Express
8条回答
  •  余生分开走
    2020-12-02 08:11

    cmd /c "command" syntax works well. Also, if you want to include an executable that contains a space in the path, you will need two sets of quotes.

    cmd /c ""path to executable""
    

    and if your executable needs a file input with a space in the path a another set

    cmd /c ""path to executable" -f "path to file"" 
    

提交回复
热议问题