Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Create ".BAT" file to "Start & Shut Down" Internet Explorer USING A KEYBOARD Key? WIN XP

Posted on 2004-09-17
6
Medium Priority
?
381 Views
Last Modified: 2013-12-04
I'm new to using BATCH files, therefore my knowledge is extremely limited.

I'm using WIN XP Pro!

My question:

How do I create a ".BAT" file using "notepad" to "Start & Shut Down" Internet Explorer by USING A KEY ON MY KEYBOARD?

A Detailed answer would be greatly appreciated since my knowledge with batch files is very limited.

THANKS A BUNCH!
0
Comment
Question by:crepair
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 
LVL 85

Expert Comment

by:oBdA
ID: 12089340
Save this batch someplace as SwitchIE.cmd (or whatever you want to name it). Create a shortcut to it someplace. Right-click the shortcut, choose "Properties", and enter a key in the "Key combination" field ("I", for example). In addition, set the shortcut to start the command in a minimized window (IE will still appear in a regular window).
The script will (without further warning) close any open instances of IE if it finds some; if it doesn't, it will start IE instead.

====8<----[SwitchIE.cmd]----
@echo off
setlocal
set Process=%ProgramFiles%\Internet Explorer\iexplore.exe

for %%a in ("%Process%") do set ExeFile=%%~nxa

tasklist | find /i "%ExeFile%" >NUL
if errorlevel 1 (
  start "" "%Process%"
) else (
  taskkill %ExeFile% >NUL
)
====8<----[SwitchIE.cmd]----
0
 
LVL 11

Expert Comment

by:turn123
ID: 14012278
The script errored when I ran it.

ERROR: Invalid Argument/Option - 'iexplore.exe'.
Type "TASKKILL /?" for usage.
0
 
LVL 85

Accepted Solution

by:
oBdA earned 2000 total points
ID: 14014369
The "taskkill" line should have been
taskkill /im %ExeFile% >NUL
0

Featured Post

When ransomware hits your clients, what do you do?

MSPs: Endpoint security isn’t enough to prevent ransomware.
As the impact and severity of crypto ransomware attacks has grown, Webroot has fought back, not just by building a next-gen endpoint solution capable of preventing ransomware attacks but also by being a thought leader.

Question has a verified solution.

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

Recently, a new law in my state forced us to get a top-to-bottom analysis of all of our contract client's networks. While we have documentation, it was spotty at best for some - and in any event it needed to be checked against reality. That was m…
Many people tend to confuse the function of a virus with the one of adware, this misunderstanding of the basic of what each software is and how it operates causes users and organizations to take the wrong security measures that would protect them ag…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

730 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