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?
windows command-line shell cmd.exe make
add a comment |
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?
windows command-line shell cmd.exe make
Try adding /q to your command.del /q /s *.pyc
– Appleoddity
Feb 12 at 0:54
See also this question on a related but different topic: superuser.com/questions/1037133/…
– Andreas Maier
Feb 12 at 1:47
Appleoddity: The actual del command was using /q /f, I simplified it somewhat.
– Andreas Maier
Feb 12 at 1:48
add a comment |
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?
windows command-line shell cmd.exe make
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?
windows command-line shell cmd.exe make
windows command-line shell cmd.exe make
edited Feb 12 at 0:11
Andreas Maier
asked Feb 12 at 0:01
Andreas MaierAndreas Maier
1213
1213
Try adding /q to your command.del /q /s *.pyc
– Appleoddity
Feb 12 at 0:54
See also this question on a related but different topic: superuser.com/questions/1037133/…
– Andreas Maier
Feb 12 at 1:47
Appleoddity: The actual del command was using /q /f, I simplified it somewhat.
– Andreas Maier
Feb 12 at 1:48
add a comment |
Try adding /q to your command.del /q /s *.pyc
– Appleoddity
Feb 12 at 0:54
See also this question on a related but different topic: superuser.com/questions/1037133/…
– Andreas Maier
Feb 12 at 1:47
Appleoddity: The actual del command was using /q /f, I simplified it somewhat.
– Andreas Maier
Feb 12 at 1:48
Try adding /q to your command.
del /q /s *.pyc– Appleoddity
Feb 12 at 0:54
Try adding /q to your command.
del /q /s *.pyc– Appleoddity
Feb 12 at 0:54
See also this question on a related but different topic: superuser.com/questions/1037133/…
– Andreas Maier
Feb 12 at 1:47
See also this question on a related but different topic: superuser.com/questions/1037133/…
– Andreas Maier
Feb 12 at 1:47
Appleoddity: The actual del command was using /q /f, I simplified it somewhat.
– Andreas Maier
Feb 12 at 1:48
Appleoddity: The actual del command was using /q /f, I simplified it somewhat.
– Andreas Maier
Feb 12 at 1:48
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1404637%2fwindows-cmd-c-enters-interactive-mode%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1404637%2fwindows-cmd-c-enters-interactive-mode%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Try adding /q to your command.
del /q /s *.pyc– Appleoddity
Feb 12 at 0:54
See also this question on a related but different topic: superuser.com/questions/1037133/…
– Andreas Maier
Feb 12 at 1:47
Appleoddity: The actual del command was using /q /f, I simplified it somewhat.
– Andreas Maier
Feb 12 at 1:48