Solved

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

Posted on 2004-09-17
6
375 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
  • 2
6 Comments
 
LVL 83

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 83

Accepted Solution

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

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

In today's information driven age, entrepreneurs have so many great tools and options at their disposal to help turn good ideas into a thriving business. With cloud-based online services, such as Amazon's Web Services (AWS) or Microsoft's Azure, bus…
Users of Windows 10 Professional can disable automatic reboots using the policy editor. This tool is not included in the Windows home edition. But don't worry! Follow the instructions below to install (a Win7) policy editor on your Windows 10 Home e…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

773 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