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
Solved

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

Posted on 2004-09-17
6
376 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 84

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 84

Accepted Solution

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

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Utilities to reset local Win 10 passwords 13 132
Read-only access for auditors 5 78
Disable SSLv3.0/TLSv1.0 - Windows 2012R2 3 46
FTP server windows 2008 5 39
This is a guide to the following problem (not exclusive but here) on Windows: Users need our support and we supporters often use global administrative accounts to do this. Using these accounts safely is a real challenge. Any admin who takes se…
OfficeMate Freezes on login or does not load after login credentials are input.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

860 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