简体   繁体   中英

cannot run 'start' command from makefile in windows

I am using gnu make 3.8.1 (mingw32) in Windows 7 operating system. I want to run 'start' command from makefile but it is giving some error. my syntax of command is-

start CMD /K http-server ./www -c-1

This command works when manually typed in cmd. It opens a new command prompt which runs the command 'http-server ./www -c-1', hosts the files present in www folder of current directory on port 8080 and shows the logs in the command prompt window it opened. but in makefile, it doesn't seems to work. My makefile is-

hostx:
    start CMD /K http-server ./www -c-1

There is more to the makefile but we only need to focus on this part. when i type 'make hostx' in cmd it shows the following output. I am posting my cmd output as complete image so this is more clear

我的命令提示符输出

any ideas how i could get it to work? also i don't know what does this error mean.

Only Windows 95/98/ME have a program called start.exe, in other versions of Windows it is an internal command inside cmd.exe.

To use the start command you need to invoke cmd.exe first:

CMD /C start CMD /K http-server ./www -c-1

If http-server is a console program or batch file then you don't need the CMD /K part because Windows will create a new console automatically. CMD /C start http-server ./www -c-1 should be enough.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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