crepair
asked on
Create ".BAT" file to "Start & Shut Down" Internet Explorer USING A KEYBOARD Key? WIN XP
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!
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!
The script errored when I ran it.
ERROR: Invalid Argument/Option - 'iexplore.exe'.
Type "TASKKILL /?" for usage.
ERROR: Invalid Argument/Option - 'iexplore.exe'.
Type "TASKKILL /?" for usage.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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%\Int
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]--