1

Anytime I use cmd, the window shrinks and snaps to the top left corner of my screen . This happens regardless of terminal emulator (Visual Code integrated terminal, CMDer, "run -> cmd", Powershell -> cmd). Here's a pic of the size it snaps to.

Gif of the problem

Additionally, I can see it flash the actual default size for a few frames before shrinking/snapping to this position. If I click the 'restore' icon, it adjusts to the default size I had preset. There is no other unusual behavior.

It's particularly a nuisance working with npm/node output, the output is immediately hidden, as it only shows a single line at a time.

I've checked the defaults/properties of the command window, everything is correct. I've checked the registry, and everything also seems fine there.

The issue seems to be exclusive to the invocation of cmd.exe. If I run python scripts etc, everything is fine.

Any ideas? I'm pulling my hair out!

6
  • In Properties > Layout, try to change Windows Size and click OK.
    – harrymc
    Oct 3, 2018 at 9:04
  • That doesn't fix anything, unfortunately. That allows me to resize the window, but if I type 'cmd' or run an npm/node script it immediately shrinks. Oct 3, 2018 at 13:58
  • Does this happen when booting in Safe Mode? (Please add "@harrymc" to your answer.)
    – harrymc
    Oct 3, 2018 at 14:02
  • It does appear to happen in Safe Mode @harrymc I've also attached a gif to my original post to give a better idea of what's going on. Oct 3, 2018 at 14:17
  • This means a problem in Windows. Try sfc /scannow.
    – harrymc
    Oct 3, 2018 at 14:32

2 Answers 2

0

You might have installed some extension or are running some script when cmd starts.

Please check and report on the contents of the following registry keys. Especially the item EnableExtension should be zero.

HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor
HKEY_CURRENT_USER\Software\Microsoft\Command Processor
4
  • Oooo, looks like the issue could be here. I found the following value in AUTORUN "@mode 20,5 & tasklist /FI "IMAGENAME eq SoundMixer.exe" 2>NUL | find /I /N "SoundMixer.exe">NUL && exit & if exist ( start /MIN "" & tasklist /FI IMAGENAME eq explorer.exe" 2>NUL | find /I /N "explorer.exe">NUL && exit & explorer.exe & exit ) else ( tasklist /FI "IMAGENAME eq explorer.exe" 2>NUL | find /I /N "explorer.exe">NUL && exit & explorer.exe & exit ) If I change this value to '0' the resizing stops, but if I type 'npm -v' 'The syntax of the command is incorrect /F was unexpected at this time Oct 3, 2018 at 16:42
  • Export the entry for backup and delete it - standard cmd does not need any add-ons or autorun tasks.
    – harrymc
    Oct 3, 2018 at 18:21
  • I'll go ahead and mark this as the correct answer. However I still can't get npm to work, even after reinstalling node/npm, always get the following message. The syntax of the command is incorrect The syntax of the command is incorrect The syntax of the command is incorrect /F was unexpected at this time Oct 4, 2018 at 1:39
  • Nevermind, this has to do with changing EnableExtension to 0. If I change it back to 1, everything works as intended. Oct 4, 2018 at 1:59
0

On your Command Prompt shortcut Properties, make sure that on the Layout tab you have 'Let system position window' enabled.

1
  • Unfortunately, that doesn't affect anything. Oct 3, 2018 at 13:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .