undefinedfix
Sign in

How does bat call CMD to keep the window displayed?

qbbss edited in Sun, 04 Jul 2021
@echo off
D:
cd D:\VueThink\test
npm run dev

I tried all the methods on the Internet, but they didn't work,

  • cmd /k
  • pause

It's useless. What should we do?

PS: the webpack package used is wrong, but the window flashes by without error message. If the compilation is normal, the window will not exit

3 Replies
Merritt
commented on Mon, 05 Jul 2021

It can't be solved. It's related to the NPM command. The compromise solution is to save the log and check it

code
@echo off
D:
cd D:\VueThink\test
npm run dev   >  log.txt
openHBP
commented on Mon, 05 Jul 2021

Emmmm doesn't know bat, but it seems to be a NPM command problem. In the laravel project, the exit command is after run dev, so the window is closed. I use run watch to open the window

Rolf
commented on Mon, 05 Jul 2021

The first way

Drag bat directly into CMD and enter

The second way

Enter CMD and enter the following three lines of code line by line:

D:

cd D:\VueThink\test

npm run dev
lock This question has been locked and the reply function has been disabled.