windows cmd /c enters interactive mode

A friend of mine has a Windows 10 system that shows the following behavior:

When GNU make is used to run a command using "cmd /c" and the command string contains a wildcard character, then the invoked cmd.exe does not terminate (as documented for the /c option) but stays in interactive mode.

Example makefile:

clean: @echo makefile: making clean -cmd /c del /s *.pyc @echo makefile: made clean

Invoking make:

(prompt) > make clean
makefile: making clean
cmd /c del /s *.pyc
Microsoft Windows [Version 10.0.17134.523]
(c) 2018 Microsoft Corporation. All rights reserved.
(prompt) >

When entering exit, the makefile continues:

makefile: made clean

So obviously the cmd /c ... invokes the command processor in interactive mode.

When the asterisk is removed, that does not happen:

Example makefile:

clean: @echo makefile: making clean -cmd /c del /s x.pyc @echo makefile: made clean

Invoking make:

(prompt) > make clean
makefile: making clean
cmd /c del /s x.pyc
The system cannot find the file specified.
makefile: made clean
(prompt) >

This happens exactly when an asterisk is in the command line, or when double quotes are used (as in cmd /c "del /s x.pyc").

I have never seen such a behavior before, and i don't have Windows 10 to try it out myself.

Does anyone know why it enters the command processor in interactive mode?

3 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like