Category Filter

Script to download and install Enterprise app (EXE) from its download link

Enterprise apps are apps that are tailored to meet the needs of an organization. Hexnode users can deploy scripts to download and install such apps on Windows 10 devices.

Disclaimer:

The Sample Scripts provided below are adapted from third-party Open-Source sites.

.bat format

E.g., To install a program abc.exe in the Desktop of the user Deborah,


bitsadmin.exe /transfer "abctransfer" http://download.url/abc.exe C:\Users\Deborah\abc.exe
Start C:\Users\Deborah\abc.exe

Notes:

You need not install the program with the same name used in the download URL. You can put a more comprehensive name when you give the name and path of the .exe file. Make sure that you call the Start command of the program with the newly assigned name.

.ps1 format

E.g., To install a program abc.exe


$file=’abc.exe’
$url=’downloadable_link’
Invoke-WebRequest –Uri $url -OutFile $file
$installProcess =(Start-Process $file –Wait)
if (installProcess.ExitCode-ne 0){
Write-Host ‘Installation failed’
exit installProcess.ExitCode
}
else{
Write-Host ‘Installation successful’
}

Notes:

  • Make changes to $file variable to give a new name to the program.
  • Only apps that support silent installation will be installed without user intervention. Some exe installers cannot be run silently. In such cases those apps will require the user to grant permission or accept an agreement to be installed on the device.
  • It is recommended to manually validate the script execution on a system before executing the action in bulk.
  • Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.