Cannot run cl.exe in MSVC developer console after months of successful running

Markus Zhang 1 Reputation point
2022-05-22T13:54:57.9+00:00

This is really weird. Here is what happened:

I have been using the X86 and X64 MSVC developer console )with Admin privilege) for a few months without any issue. I'm only using the cl.exe program to compile sample programs, such as:

cl 1_19_5_float.c /Fa1_19_5_float.asm /MD /Od /arch:IA32

15 minutes ago, I ran a few compiling and everything still worked fine. I left for 5 minutes, no one touched my computer and both consoles were kept open. Suddenly cl.exe failed to work. Every time I ran the command it kept telling me that "This app can't run on your PC", and showed "Access is denied" in the console.

Is there any way to track the issue down? I absolutely have no idea what's going on. I checked the cl.exe under C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x86 and C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64 and both are still there. TBH I only left for 5 minutes, what could go wrong? I even checked Event Viewer but nothing suspicious caught my eye. There was no Microsoft Update either.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,183 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Markus Zhang 1 Reputation point
    2022-05-22T14:11:42.75+00:00

    OK I got the answer. Somehow, an empty cl.exe was created in the folder and everytime I ran the command it calls this file. I have no idea how it was created. Might be a malware but I suspect it was created by me accidentally because I also found an empty "cl" (without .exe).

    0 comments No comments