Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
884 views
in Technique[技术] by (71.8m points)

windows 7 x64 - CMD.exe closes immediately after calling (Win7 64)

Has anyone found such behavior when Command Processor (cmd.exe) closes immediately after calling it? I’ve run McAfee AV and Windows System File Check (sfc.exe) and nothing wrong was detected, I’ve even copied cmd.exe file from other win 7 machine and it is still working same way. Strangest thing is – on the windows 7 64 there is also 32 bit version of that file which works perfectly normal.

SysInternals Process Monitor shows that cmd.exe process ends with exit code 0x0... o_O

Also calling commands directly from start menu, like ping, works normal…

Maybe that question is not strictly related to coding but that issue holds me from doing many things related to actual application development and environment check.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Answering all questions:

  • superuser, safe mode, run as admin, changing ownership and permissions - didn't help
  • I was calling by menu start as well as d-clicking cmd.exe with same result,
  • No virsus either malware found by today's scanning with McAfee, Anti-malware, MS Malicious removal... etc

Finally I got it SOLVED:

  • Run regedit
  • Go to HKLMSoftwareMicrosoftCommand Processor or HKEY_CURRENT_USERSoftwareMicrosoftCommand Processor or HKEY_LOCAL_MACHINESoftwareMicrosoftCommand Processor

  • For some reason there was AUTORUN key with "EXIT" inside.

  • Remove the AutoRun key and everything should went back to normal.
  • CMD.exe should start to work again.

Also,

In some cases, the Command prompt is also opening on Startup, which is when the above solution is applied hangs the system on Command prompt when you logon.

This can be fixed by using Autoruns, where you need to disable command prompt startup registries on Logon/Startup tab. (there can be more than one entries)

That one also explains why exit code was 0x0.

Have no idea what kind of thing set that key up... McAfee showed some activity lat week and I've noticed it last Friday.

Hope these symptoms and my answer will help someone in future


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...