Reputation:
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.
Upvotes: 3
Views: 2103
Reputation: 101756
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.
Upvotes: 5