Setup of script to verify a process, then start if necessary?
We use the Google Drive for Desktop (https://www.google.com/drive/download/) app in our environment for Windows users to store files in the cloud. Every now and then, this program updates, but doesn't relaunch. It's not hard to relaunch it (the user simply launches it from the start menu), but I'm trying to make sure this app is always running. I tried a trick to add it to the run key of the registry, but then the users are nagged by a notification saying basically, "this is already running".
So I figured I would use a script from the SDA that checks hourly to see if it's running, and if not, it launches it.
The problem I'm running into... The Remediation directory looks like it has to be a direct link to the executable, rather than a link to the Start Menu shortcut. I don't want to use the direct link to the exectuable, because this could (and likely will) change with each new version. When I DO use the link to the executable, it works great and does what I want with launching the app if it's not running. So, in other words... This works:
But THIS does not:
As you can see, the directory path in the first screen shot is absolute, so any version updates are going to break this. That's why, in the 2nd screen shot, I was just trying to call a shortcut that I know will work in the future.
I thought about using a PATH variable, but I'm running into the same problem there, where it can't just link to a .lnk file.
Any ideas on how I could achieve this?
Be the first to answer this question