Cannot run .exe from Network Drive

Solution 1:

If the server is running Samba, then you may need to add this option to the [global] section of smb.conf:

acl allow execute always = True

Source: Execute a .exe on a samba share - unix.stackexchange

This will tell Windows that all the files can be executed and beats running chmod a+x * for all files in the share, which also works.

Solution 2:

It seems unlikely the OP is ever going to return, so I’ll address two specific cases that could have caused this:

When you have to enter credentials to access the network resource or if you are operating on a mapped drive, elevating a process may fail because of UAC.

This is because with UAC you are actually logged in with two sessions, one with administrative access and one without. These sessions are mostly separate, they don’t share mapped drives or network login tokens.

Your non-admin session has its mapped drives and any network login tokens. After confirming the UAC dialog, Windows tries to load the program in the admin session. It doesn’t have any network login tokens nor the mapped drives. As such, it will fail with either “file not found” or “access denied”.

Microsoft describes this behavior in greater detail in this article on TechNet.

Luckily, there is a workaround, enabling “Linked Connections” (described in the article mentioned above). The following .reg file will accomplish this:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"EnableLinkedConnections"=dword:00000001

Solution 3:

You might check with the developer to see if the executable you are launching is just a wrapper for one or more secondary executable's, which also have a particular path requirement.

You may need a specific drive letter mapped (eg you are launching from G: but the wrapped executable expects an H:), or to be authenticated to a different machine, or just a missing component.

Tools you can use:

  1. Dependency Walker This tool will tell you if your executable cannot find some component.
  2. Strings.exe. Run it against your executable. This tool will give you ascii characters that are human readable. Up to you to decide if they are relevant.
  3. A conversation with the developer or system integrator may go a long way to solve the missing path issue.

Solution 4:

There are a large number of reasons you could see that:

I would start with disabling UAC and check if this solves the problem. Then you know it is a permission issue and will "only" need to fix the specific issue there.

I do not remember if you can have Windows network drives mounted without the option to execute files as well.

Additionally checking the same file with another computer would be helpful as well, (Virtual one with another Windows OS f.e.)

For more in-depth steps:

Quote from Microsoft support:

This issue can occur if any of the following scenarios exist on your PC.

  • You do not have permissions to the file or the file location.
  • The file is on a location that is not currently accessible like a network location or an external drive that is not currently connected to the PC.
  • The file has been moved or deleted.
  • The file or shortcut is corrupt.
  • The file may be blocked by Windows.
  • Your antivirus software may be blocking the file.