Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows deletes make executable file upon running. Why?

I am trying to get some code running which uses make. I've downloaded and installed both MinGW (standard 32 bit) and TDM-GCCs flavor of MinGW on my 64-bit Windows 7 machine.

When I run make (i.e. mingw32-make.exe) in Administrator mode, I get the following error message:

Windows cannot access the specified path, or file. You may not have the appropriate permissions to access the item.

The weird/scary part is that, upon running, it immediately deletes the exe file.

I ran a checksum SHA1 as recommended in the comments using the Microsoft (R) File Checksum Integrity Verifier V2.05:

C:\path\to\folder>fciv.exe -sha1 mingw32-make.exe
//
// File Checksum Integrity Verifier version 2.05.
//
c8ae5c780ab7bed652883d6443b5bfe5e23d30c9 mingw32-make.exe

I don't understand what this output means, but maybe it's helpful to someone.

Notes:

  1. This happens regardless of where the file is located on my pc.
  2. This behavior is specific to the make program (others such as gfortran and gcc appear to be working fine)
  3. Renaming the file makes no difference.
  4. I am an administrator on the pc
  5. Same behavior when I run the program from the explorer or command line.
  6. My anti-virus program (Avast) does not detect any problems with the file when I scan it.
  7. I got the MinGW setup file from this SourceForge page.
  8. I got the TDM-GCC web installer from this page.
  9. The file size is 219,662 bytes (from both the main MinGW and TDM-GCC packages)
  10. I have run make from the command line where I have started the command prompt by way of selecting Run as Administrator in the context menu.
  11. I have also tried to run make by selecting Run as Administrator when I have it selected.
  12. I run the command mingw32-make when this behavior occurs. I have also tried renaming it to things like make and foo with the same result.
  13. The first time this happened with both MinGW it deleted the original file and I re-installed it using the mingw-get application. From thereon after I started making copies of the original mingw32-make for testing.
  14. For the make executable, I have all permissions (including Read & execute) except the special permissions field.
like image 372
NauticalMile Avatar asked Feb 04 '16 06:02

NauticalMile


People also ask

Why is Windows deleting EXE files?

Reasons for EXE Files Loss The most apparent reason for the issue “lost EXE file” is antivirus settings or virus or malware infection. Most of the viruses or malware are delivered through executable files, and the antivirus programs always make most of the executable files suspicious and block or even delete them.

How do I stop Windows from deleting EXE files?

Step 1: In the “Settings,” go to “System” and look for the “storage” option. Step 2: The “Storage Sense” option is “On” by default. Turn it off so that Windows 10 doesn't delete any of the files from recycle bin or downloads folder automatically.

Why does my file keep deleting itself?

Windows Storage Sense feature: The main reason for this problem is due to a newer feature of Windows called "Storage Sense". If you turn on this feature, it will automatically delete unused files and temporary files when your computer is running low on disk space.

Is executable file a virus?

An .exe file can be a virus, but that is certainly not true for all of them. In fact, the majority are safe to use or even necessary for your Windows system to run. It all depends on what is in an .exe file. Basically .exe files are programs that have been translated into machine code (compiled).


1 Answers

After using the process manager I found out it was indeed Avast that was the problem :S A couple of lines revealed avast actually deleted the file before windows got around to executing it, which was the reason for the windows message. I put Avast on 'Silent Mode' a while back; I thought the only purpose of this mode was to suppress notifications about minor updates, but apparently it also gave Avast permission to deal with 'threats' silently as well.

After figuring that out the solution was straightforward. I just went into the settings and created an exception for the mingw32-make.exe file. It now runs without issue.

Thanks very much for your help everyone!

like image 142
NauticalMile Avatar answered Oct 04 '22 00:10

NauticalMile