Created
November 2, 2017 08:17
-
-
Save pisceanfoot/440b7d0489d26283916818209eb0f5ce to your computer and use it in GitHub Desktop.
process watchdog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$programName = "RealTimeSync" | |
$isRunning = (Get-Process | Where-Object { $_.Name -eq $programName }).Count -gt 0 | |
if(!$isRunning){ | |
echo 'not found RealTimeSync' | |
Stop-Process -processname "RealTimeSync*" | |
Start-Process -FilePath "C:\Program Files\FreeFileSync\RealTimeSync.exe" -ArgumentList "E:\sync\Realtime.ffs_real" -WorkingDirectory "C:\Program Files\FreeFileSync" | |
exit | |
} | |
$programName = "RealTimeSync_x64" | |
$isRunning = (Get-Process | Where-Object { $_.Name -eq $programName }).Count -gt 0 | |
if(!$isRunning){ | |
echo 'not found RealTimeSync' | |
Stop-Process -processname "RealTimeSync*" | |
Start-Process -FilePath "C:\Program Files\FreeFileSync\RealTimeSync.exe" -ArgumentList "E:\sync\Realtime.ffs_real" -WorkingDirectory "C:\Program Files\FreeFileSync" | |
exit | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment