Solved

Windows Script to verify if a program is running and if not, boot this program.

Posted on 2014-11-07
2
210 Views
Last Modified: 2014-11-17
I'm looking for a script that would run in the background of windows automatically when windows is booted.

This script should check the list of running processes for Internet Explorer and if it cannot find it, it should launch Internet explorer.

I'm trying to run this on Windows 8.1 Pro.

Does anyone have any idea of how I could get this started? Eventually show some lines of code on how this would work.

If you have any other questions I will try to answer them.

Thanks in advance.
0
Comment
Question by:BBICT
2 Comments
 
LVL 15

Expert Comment

by:ZabagaR
ID: 40428664
You could make a script and add a windows scheduled task.  Add a scheduled task that runs at either system startup or user logon. I'm thinking user logon, otherwise you'll likely end up with iexplore.exe running headless in the background.  

The scheduled task could call a sample batch script like this:

tasklist /FI "IMAGENAME eq iexplore.exe" > nul
if %errorlevel% neq 0 call "c:\program files\internet explorer\iexplorer.exe"
0
 
LVL 14

Accepted Solution

by:
Rob Miners earned 500 total points
ID: 40429885
Another approach would be to use the Users startup folder in Windows 8.1

Press the WinKey + r
Type or Copy/Paste the below syntax in the Run Box and press Enter.

%appdata%\Microsoft\Windows\Start Menu\Programs\Startup

Press the WinKey + r
Type or Copy/Paste the below syntax in the Run Box and press Enter.

notepad.exe

Type or Copy/Paste the below syntax into notepad and save the file as CheckIE.cmd into the Startup folder.
@echo off
tasklist /nh /fi "imagename eq iexplore.exe" | find /i "iexplore.exe" > nul || (start iexplore.exe)
exit

If you want All Users to run the file place the batch file here.

%programdata%\Microsoft\Windows\Start Menu\Programs\Startup
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question