Congratulations to AcaCandy on her 100,000th post!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen blue screen boot bsod computer connection crash css dell display drive driver drivers email error ethernet excel firefox firefox 3 game hard drive internet internet explorer itunes laptop linux malware monitor network networking nvidia outlook outlook 2003 outlook 2007 outlook express partition problem router slow software sound trojan usb video virus vista windows windows xp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
Batch File Help


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
evangelistc01's Avatar
Computer Specs
Member with 35 posts.
 
Join Date: Apr 2007
Experience: Intermediate - Hardware
22-Jan-2008, 08:07 AM #1
Batch File Help
I'm not ms-dos savvy, but I was wondering if I could have help throwing together a quick batch file (should be easy for you guys XD). Could a batch file achieve the following?

When I click on the shortcut to another application (lets say, a game), I need it to open another application at the same time. When I close the game, it needs to close the other application as well.
__________________
play music // play the web: songbird
lite music editing software: REAPER
visualize music... magnetically: magnetosphere
devil_himself's Avatar
Distinguished Member with 4,844 posts.
 
Join Date: Apr 2007
Location: India
Experience: Advanced
23-Jan-2008, 12:48 AM #2
You Can Start Both The Applications Using The Batch File

Quote:
When I close the game, it needs to close the other application as well
You Can User "Tasklist" To Determine If The Application is Running or Not .... If Not Running You Can "Taskkill" To Kill The Second Application .. If Still Running You Can ask The Script To Sleep For a particular Time and wait for the app to terminate

Try Something Like This

To Make The Batch Wait

Code:
setlocal
set seconds=%1
if "%seconds%"=="" set seconds=5
ping -n %seconds% localhost >nul
endlocal
To Determine If App is Running Or Not

Errlvl = 0 --> Running , Errlvl = 1 --> Not Running

Code:
Tasklist | Find /i "Notepad.exe"
IF "%ERRORLEVEL%" == "0" (
ECHO  Running
) Else (
Taskkill /f /im calc.exe
)

Last edited by devil_himself : 23-Jan-2008 12:56 AM.
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 04:11 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.