Jump to content

How can I start and stop a program using a hotkey


xmrkite
 Share

Recommended Posts

Hello, I want to start internet explorer and close it by using the same hotkey (ctrl + alt + F9)

I see that I can use my hotkey to open internet explorer, but not to close it.

The idea is to open this from xbmc and use the same button on my remote control to open and close internet explorer.

So I created a script to open and close it and it works great, but there is one issue. I use the following batch file:

---------------------------------------------------------------------

set tempfile=bdw.txt

tasklist > %tempfile%

type %tempfile% | find /i "iexplore.exe"

if errorlevel 0 if not errorlevel 1 goto IsRunning

"C:\Program Files\Internet Explorer\iexplore.exe"

exit

:IsRunning

C:\Windows\system32\taskkill.exe /F /IM iexplore.exe

goto exit

---------------------------------------------------------------------

The problem is that while I need the command prompt to remain open so that xbmc behaves nicely and stays minimized, the script doesn't want to work again till i close out the command prompt.

Any ideas?

-Thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy