Help Needed Creating Batch File


  1. Posts : 17
    Windows 7 64 Bit
       #1

    Help Needed Creating Batch File


    Hi,

    I have 2 files that are in the same directory which I want to start one after the other.

    I have created a simple batch file like this which opens 2 files at the same time.

    Example

    Start Server.exe
    Start Game.exe

    Is it possible to leave say a 10 second gap between opening the Server.exe and Game.exe? Also is it possible to quit Server.exe when I exit Game.exe?

    It probably isn't possible but I am pretty useless at scripts and need some help.

    Any help would be appreciated.
      My Computer


  2. Posts : 184
    Windows 7 Ultimate x64 sp1
       #2

    Here you go. Just put the location where the first.exe and second.exe are.
    The 10000 = 10 seconds.

    example.
    start "HandBrake" "G:\Program Files\HandBrake\Handbrake.exe"


    @ECHO OFF
    start first.exe
    echo wscript.sleep 10000 > temp.vbs
    start /wait temp.vbs
    start second.exe
    del temp.vbs
      My Computer


  3. Posts : 17
    Windows 7 64 Bit
    Thread Starter
       #3

    Thanks rustberger. It worked like a treat. Is it possible to quit the first loaded file after the second file exits?

    I guess this isn't something that a simple batch file can do and is more a programming issue?
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 19:17.
Find Us