How to bypass security warning when running EXE from network location? How to bypass security warning when running EXE from network location? powershell powershell

How to bypass security warning when running EXE from network location?


The network share is not trusted by your computer, hence it warns you. You would have to add the share to the trusted zone in the systems internet settings, and allow "launching programs and unsafe files".

You cannot bypass it, but

  • add the required configuration to the registry
  • or copy the files locally and run it from there

using PowerShell


You can bypass the warning by adding -NoNewWindow as in Start-Process "\\192.168.5.7\MSChart.exe" -ArgumentList "/q" -Wait -NoNewWindow.

You should however leverage DNS for your path (e.g. \\share.domain.com\file.exe) and ensure the URI (share.domain.com) is in your system 'Trusted Sites' or 'Intranet Sites' list or you may still be blocked. Copying the file to the local system first may also fix the problem.

Reference: https://social.technet.microsoft.com/Forums/en-US/92eab96d-fe1a-4119-a5bc-f171d517466a/getting-open-file-security-warning-using-startprocess?forum=winserverpowershell


Maybe you want to Unblock-File and accept all of the risks that come with that and then try to execute it?

I don't recommend anyone EVER run a script like this:

function Unblock-Dir() {    gci -Directory | % {     push-location $_ ;     gci | % {       Write-Host "Unblocking $_";      Unblock-File $_     }     Unblock-Dir ;     Pop-Location   }   Unblock-File -path .\* }

It's just too dangerous.