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.
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.
# Replace "FileAddress" with the file path of the process you want to start in the device’s background.
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.
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’.