Category filter

Script to start processes on Windows using Start-Process

The Start-Process command cmdlet can be used to launch executables, scripts, and files that can be opened with an associated program. It can be used within scripts to automate the process of starting a program, which can save time and effort. Administrators can use the script to troubleshoot or run background processes on multiple devices simultaneously, which can help them maintain centralized control over the devices. Use Hexnode’s Execute Custom Script feature to remotely execute the scripts on your Windows devices.

Disclaimer:


The sample scripts provided below are adapted from third-party open-source sites.

PowerShell script

The following script starts the specified processes on Windows devices. You can use this script to automate the task of starting multiple processes on a device.

Enter an executable file or script file, or a file that can be opened using a program on the device. The command starts the program associated with the file when a non-executable file is specified.

Examples:

1. Execute the following script to run the Google Chrome application on the device in its background. The .exe file is present in the path C:\Program Files\Google\Chrome\Application.

Start-Process 'C:\Program Files\Google\Chrome\Application\chrome.exe'

2. The below script will silently install the Cloudflare app whose MSI file has been downloaded to the Downloads folder of the user ‘Deborah’.

Start-Process 'C:\Users\Deborah\Downloads\Cloudflare_WARP_Release-x64.msi'

Notes:

  • The processes included in the script starts to run (in the background) as the action executes successfully.
  • 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.

  • Sample Script Repository