On two of my Win10 systems, I can swap between Powershell and command prompt. But on the third there's a most peculiar problem.
Settings/Personalisation/Taskbar has the option to switch between the two. When I set it to CMD, CMD appears for a second in a tiny window and then disappears. I can't get it to stay put.
I've run DISM and sfc, have the latest 22H2 19045.5796 build.
Ed
On two of my Win10 systems, I can swap between Powershell and command prompt. But on the third there's a most peculiar problem. Settings/Personalisation/Taskbar has the option to switch between the
two. When I set it to CMD, CMD appears for a second in a tiny window and then disappears. I can't get it to stay put.
I've run DISM and sfc, have the latest 22H2 19045.5796 build.
VanguardLH wrote:
mpcmdrun.exe -scan -scantype 2 > %temp%\mpscan.txt & notepad
%temp%\mpscan.txt
Thanks for jumping to help.
No sign of CMD in Task Manager, nor in Reliability Monitor.
The shortcut points to the version in system32, which I tried by
clicking on it in situ; same brief flash.
Cmd.exe and cmd.exe/k produce the same phenomenon.
I've run DISM and sfc /scannow again, plus done a full chkdsk c: /f /r.
I'm now running a full Windows Defender scan; fingers crossed.
Ed
Ed Cryer <ed@somewhere.in.the.uk> wrote:
On two of my Win10 systems, I can swap between Powershell and command
prompt. But on the third there's a most peculiar problem.
Settings/Personalisation/Taskbar has the option to switch between the
two. When I set it to CMD, CMD appears for a second in a tiny window and
then disappears. I can't get it to stay put.
I've run DISM and sfc, have the latest 22H2 19045.5796 build.
Not sure what config wizard setting to which you refer. When I
right-click on a blank area of the Taskbar, click on Taskbar Settings in
the context menu, I don't see a toggle choosing between Command or Powershell. I see:
Replace Command Prompt with Windows PowerShell in the menu
when I right-click the start button or press Windows key+X.
The only times I start cmd.exe this way is when reading some online help
file on starting cmd.exe. I use a shortcut to cmd.exe, and the shortcut
is in a toolbar in the Taskbar configured to run with admin privs (so
the UAC prompt appears). I can also click on the Start menu button, and enter "cmd" which shows Command Prompt as a match. The first match
opens in non-admin mode. Another match let me click on its rightward
chevron to get more choices, like Open or Run as administrator.
How are you starting cmd.exe? If using a shortcut, make sure to add the
/k command-line argument to keep open the console window, like:
cmd.exe /k
Normally, when cmd is done running whatever your told it to run, the
console window closes, because the cmd shell unloads after running
whatever you told cmd.exe to run. You want to keep the shell loaded, so
add /k switch. Also check which cmd.exe the shortcut specifies. Have
it point at the one under the system32 folder.
In Task Manager, check if any instances of cmd.exe are running. If so,
kill them. You don't say how you run cmd. Try the following:
- Bring up the Task Manager (Ctrl+Shift+Esc).
o Select the Details tab.
o Click on the Name column header to sort by process name.
o Scroll down to where the C's would start.
o Check there are no running instances of cmd.exe
- Run cmd.exe:
o Bring up the Run dialog (Win+R).
o Or, use the File -> Run new task menu in Task Manager.
- Enter: cmd.exe. Include the .exe extension. Click OK.
See a console window now?
Did the console window stay open?
In Task Manager, did you see cmd.exe show up?
If you saw cmd.exe show up in Task Manager, but only temporarily, and
its console window did not stay open, do the above again; however,
instead of relying on pathing to find the cmd.exe executable file, enter
the full path to the executable: c:\windows\system32\cmd.exe.
Look in Event Viewer to see if an error got reported when trying to load cmd.exe.
cmd.exe is one of the programs often attacked by malware to prevent the
user from have a low-level tool to undo the malware. Run a full scan
using your anti-virus software. If using Windows Defender, see:
https://learn.microsoft.com/en-us/defender-endpoint/command-line-arguments-microsoft-defender-antivirus
and run:
mpcmdrun.exe -scan -scantype 2
Defender's manual scan is slow, so it will take a long time to complete.
If its console window disappears after it completes, so you don't get to
see its output, pipe stdout into a file to open in Notepad, like:
mpcmdrun.exe -scan -scantype 2 > %temp%\mpscan.txt & notepad %temp%\mpscan.txt
Ed Cryer wrote:
VanguardLH wrote:
mpcmdrun.exe -scan -scantype 2 > %temp%\mpscan.txt & notepad %temp%
\mpscan.txt
Thanks for jumping to help.
No sign of CMD in Task Manager, nor in Reliability Monitor.
The shortcut points to the version in system32, which I tried by
clicking on it in situ; same brief flash.
Cmd.exe and cmd.exe/k produce the same phenomenon.
I've run DISM and sfc /scannow again, plus done a full chkdsk c: /f /r.
I'm now running a full Windows Defender scan; fingers crossed.
Ed
Full scan ok. 57 mins. Zero threats found.
No mention of CMD in Event Viewer.
The version of CMD in SysWOW64 has the same disappearing behaviour.
However, I installed Administrator account and it works just fine from there. And the file location is the same as my user.
I'm pondering whether to run a full system repair - download Win10
latest. But there's no sign of any other problem, and this one seems too minor to warrant such extensive attention. I can use Powershell, and, in case of necessity, CMD in Administrator account.
Ed
On two of my Win10 systems, I can swap between Powershell and command prompt. But on the third there's a most peculiar problem. Settings/Personalisation/Taskbar has the option to switch between the
two. When I set it to CMD, CMD appears for a second in a tiny window and then disappears. I can't get it to stay put.
Have you seen my SOLVED posting in this thread?
It worked for me. I found it in a Google search for this problem.
I'm no expert on Win10, but I should think that the things done therein should reveal the underlying cause to someone who is.
Ed
On Fri, 25 Apr 2025 10:36:11 +0100, Ed Cryer wrote:
On two of my Win10 systems, I can swap between Powershell and command
prompt. But on the third there's a most peculiar problem.
Settings/Personalisation/Taskbar has the option to switch between the
two. When I set it to CMD, CMD appears for a second in a tiny window and
then disappears. I can't get it to stay put.
You need to invoke it with the /k option, and the only way I know to
do that is to put the command in a shortcut.
I can't imagine why you'd need /k on a cmd shortcut.
VanguardLH wrote:[...]
Update:
I have filters that will flag posts to hide them. I did not see your "SOLVED" subthread, because one of my filters flags posts that have all uppercase in the Subject. One, that is YELLING. Two, spammers and
trolls are desparate to get attention. When I switched to a view that showed ignore-flagged posts, I saw yours. I'll reply under that
subthread.
Hiya man.
It used be standard good netiquette to put "solved" in upper case; in
Web and Usenet threads. I'm not going to apologise for having done it
here.
Your filtering out of them is your personal affair. I have no
battle with upper-case abusers because I don't get any.
It used be standard good netiquette to put "solved" in upper case; in
Web and Usenet threads. I'm not going to apologise for having done it
here.
On Fri, 25 Apr 2025 13:14:45 -0700, Stan Brown
<the_stan_brown@fastmail.fm> wrote:
On Fri, 25 Apr 2025 10:36:11 +0100, Ed Cryer wrote:
On two of my Win10 systems, I can swap between Powershell and command
prompt. But on the third there's a most peculiar problem.
Settings/Personalisation/Taskbar has the option to switch between the
two. When I set it to CMD, CMD appears for a second in a tiny window and >> then disappears. I can't get it to stay put.
You need to invoke it with the /k option, and the only way I know to
do that is to put the command in a shortcut.
I can't imagine why you'd need /k on a cmd shortcut. When you launch cmd
from a shortcut, it already stays open without the /k option.
Stan Brown <the_stan_brown@fastmail.fm> wrote:
You need to invoke it with the /k option, and the only way I know to
do that is to put the command in a shortcut.
I can't imagine why you'd need /k on a cmd shortcut. When you launch cmd
from a shortcut, it already stays open without the /k option.
Char,
I can't imagine why you'd need /k on a cmd shortcut.
What the OP describes happens when then an "execute this" part has been >addded without the /k argument.
IOW, the OP /might/ not have told us everything.
Besides, adding it (just after the first, ending on \CMD.EXE, part) sounds >like a good idea as a debugging step. If the console window than stays open >...
And for the record, I've got several cmd shortcuts using the /k argument and >a batchfile which does some initializing for me.
I can't imagine why you'd need /k on a cmd shortcut.
What the OP describes happens when then an "execute this" part
has been addded without the /k argument.
I think I misunderstood. I thought we were talking about a shortcut
that only launches a Command Prompt that does nothing,
For example, create an example.bat
file containing:
echo List users ...
cmd.exe /c net users
echo
echo Check if Administrator is listed.
I've used batch scripts to do setup before cmd.exe, check
status afterward, and perform other actions both before and
after the cmd.exe call.
If I want the 2nd shell to pause for whatever it called
to execute that doesn't itself halt to show output, I have to
change /c to /k in either the batch script's call of cmd.exe,
or to the cmd.exe that the shortcut runs
In the OP's case, he had corrupted registry entries regarding
the command shell. Since he deleted those registry entries,
we don't know what they specified
Vanguard,
For example, create an example.bat
In the OP's case, he had corrupted registry entries regarding
the command shell. Since he deleted those registry entries,
we don't know what they specified
Remarkable that you just know those lines where corrupted*, even though you >have no idea what was in them.
* and not, for example, just altered due to having changed some settings in >a dialog.
But I guess "corrupted" sounds way more important than "inadvertedly >changed".
Regards,
Rudy Wieser
In the OP's case, he had corrupted registry entries regarding
the command shell. Since he deleted those registry entries,
we don't know what they specified
Uhm, don't Windows keep back-up copies of the Registry all over the
damned computer? Mine always has.
But I guess "corrupted" sounds way more important than
"inadvertedly changed".
Same thing, only more official and scary, yes?
Which, I suppose was your point. :)
Sysop: | Tetrazocine |
---|---|
Location: | Melbourne, VIC, Australia |
Users: | 8 |
Nodes: | 8 (0 / 8) |
Uptime: | 89:25:36 |
Calls: | 161 |
Files: | 21,502 |
Messages: | 78,345 |