Batch Script /Task Schedule help

Looking to create an hourly Schedule task that will launch a script. The script will launch an app if a process is not running. The process will run as logged in user.
The program to launch  is  C:\Program Files\Google\Drive File Stream\25.102.133.409\GoogleDriveFS.exe
The Process name is GoogleDriveFS.exe

It's a Windows 10 PC.
What should the Batch script be.
GGHCAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

8046586Commented:
It will be easiest to schedule 2 tasks in Task Scheduler.
1. use task kill for the google drive process in a batch file (this will be for stopping the process if eventually is still running)
2. second task for running the exe (no need of batch file for this)
You should have 1 min difference between first and second task
oBdACommented:
Try this:
@echo off
setlocal
set Process=C:\Program Files\Google\Drive File Stream\25.102.133.409\GoogleDriveFS.exe

for %%a in ("%Process%") do set ImageName=%%~nxa
tasklist.exe /fi "IMAGENAME eq %ImageName%" /FI "USERNAME eq %UserName%" | find.exe /i "%ImageName%"
if errorlevel 1 (
	echo Process '%ImageName%' not running, starting ...
	start "" "%Process%"
) else (
	echo Process '%ImageName%' is already running.
)

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GGHCAuthor Commented:
Thanks oBdA!
Anyway to have the .bat run completely hidden in the scheduled task? Even though I have "Hidden" checked there still a brief cmd pop up that shows up.
Trying to have it fully hidden.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 10

From novice to tech pro — start learning today.