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

  • SEARCH
  • Home
  • 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 7948945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:51:51+00:00 2026-06-04T01:51:51+00:00

I wrote a windows .bat script. To run a list of commands and then

  • 0

I wrote a windows .bat script. To run a list of commands and then shut down the computer.

such as:

c:\someapplication.exe
c:\someapplication2.exe
Shutdown -s -t 0

Sometimes, “c:\someapplication.exe” freezes and do not respond. How can I setup timeout for my command “c:\someapplication.exe”, so that after a certain amount of time, I want windows to force close the application and continue the rest of the commands?

  • 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-06-04T01:51:52+00:00Added an answer on June 4, 2026 at 1:51 am

    You could use a combination of ping and taskkill to do this.

    start c:\someapplication.exe
    ping 127.0.0.1 -n seconds
    taskkill /im someapplication.exe /f 
    start c:\someapplication2.exe
    ping 127.0.0.1 -n seconds
    taskkill /im someapplication2.exe /f 
    Shutdown -s -t 0 /f
    

    Just replace seconds in the ping command with the number of seconds you want to wait before attempting to close the process (enough time so if it’s still running it must have crashed). Then the rest of the app can continue until it is forced to shutdown.

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

Sidebar

Related Questions

In Windows I would create a .bat file to run this script from my
I wrote a simple .BAT script, I scheduled it in windows server for backup
I wrote a game years ago (under Windows 95) in Pascal. Since then over
I want to write .bat script which works under all flavours of Windows, no
My issue is the following: I need to run a .bat and a .exe
I wrote a c# windows application and I want to run it on other
I wrote a perl script which uses some linux commands ( grep , ls
I wrote a Windows Forms script that searched for all non-hidden and non-readonly folders
I wrote a Windows Service program, say myService.exe and it has myService.exe.config file. But
I have a bat script that I'd like to make work on windows/Mac/linux, but

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.