Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6129373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:44:06+00:00 2026-05-23T16:44:06+00:00

The start command can launch an application like notepad in a batch file like

  • 0

The start command can launch an application like notepad in a batch file like this:

start notepad
start "my love.mp3"

But how do I close the running application from the command line? I found taskkill in my searches but I don’t think that is the right command because it’s not working—it says no such file.

How do I close an application launched with start?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:44:07+00:00Added an answer on May 23, 2026 at 4:44 pm

    Taskkill is correct. But you must kill the process playing the file, not the file itself. Figuring out the registered handler for mp3 files from a command prompt will be a bit tricky.

    If you know it then you can kill that process.

    Here’s a script that figures out the registered application for mp3 files and kills the task:

    @echo off
    if not .%1==. goto show
    
    :createtemp
    set tempfile="%temp%\temp-%random%-%time:~6,5%.bat"
    if exist %tempfile% goto :createtemp
    
    reg query HKEY_CLASSES_ROOT\mp3file\shell\play\command\ > %tempfile%
    
    for /F "skip=4 delims=> tokens=2 usebackq" %%e in (`type %tempfile%`) do call %0 %%e
    
    del %tempfile% > nul
    set tempfile=
    set handler=
    set teststring=
    set offset=
    set cmd=
    goto end
    
    :show
    set handler=%2
    set handler=%handler:~1,-1%
    set /A offset=-1
    
    :loop
    set cmd=set teststring=%%handler:~%offset%%%
    echo %cmd% > %tempfile%
    call %tempfile%
    if %teststring:~0,1%==\ goto complete
    set /A offset=offset-1
    goto loop
    
    :complete
    set /A offset=offset+1
    set cmd=set handler=%%handler:~%offset%%%
    echo %cmd% > %tempfile%
    call %tempfile%
    taskkill /IM %handler% > nul
    
    :end
    

    If you save this as killmp3.bat or something, you can call it when you want. Of course be aware that if the program was already running, doing something else, that it will be closed anyway.

    Note that this depends heavily on the entry in the registry to have the executable path inside double quotes. If you don’t have that and there are spaces in the executable name, it will fail.

    You could generalize my technique to be able to pass in the file extension (such as .mp3, which you could look up in the registry to find the class name mp3file and then find the handler from there.

    A more generic solution that takes the name of the file you started and figures out the extension from it is theoretically possible but a lot more difficult. In the case of notepad you have to figure out what that is by searching the path for all executable files, etc.

    This might be simpler if you created an extremely short mp3 file that you could start. Depending on the program, it might stop playing the current file and switch to the new one, which would end almost instantly and effectively stop playback.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that using a command like: :%bdelete Using this command I can close
I have an application that can import an XML file through this terminal command
I would like a batch file to launch two separate programs then have the
Using sc command we can query, start , stop windows services. For ex: sc
How can I add a start up item via command line on a mac?
How can I start an interactive console for Perl, similar to the irb command
I would like to see the command that Eclipse is running when I hit
Here's the situation: I am trying to launch an application, but the location of
How can I script GNU Screen to start with a program running inside of
I have written a C# tool that will launch an application by running a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.