Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Wacky Question with Batch files.  (Read 2263 times)

0 Members and 1 Guest are viewing this topic.

twicedead

    Topic Starter


    Newbie

    Wacky Question with Batch files.
    « on: December 23, 2009, 01:45:06 AM »
    I used and edited batch files back in the day, but i can't remember if they can be used to wait on a program.

    Reason why i ask, i have a keyremapper -autohotkey, that i use to rebind numpad keys to function keys.  Of course this effectively eliminates the use of the keypad regularly.

    so i want to run
    autohotkey
    game.exe

    then have batch file wait on exit of game.exe
    close autohotkey.exe

    ?? feedback would be great!

    Salmon Trout

    • Guest
    Re: Wacky Question with Batch files.
    « Reply #1 on: December 23, 2009, 02:27:46 AM »
    If you are used to batch files from the old MS-DOS & Win95/98/ME days, then you will find that the command language used in Windows NT family OSs (especially Windows 2000 onwards) vastly expanded and improved. So much so that it is misleading to still call it "DOS".

    Check out the START command, and its switches. You can open a command window and type start /? at the prompt to see a list of them. I think you will find the /WAIT switch most useful.

    e.g.

    start "" /WAIT "C:\Program Files\Game Folder\Game.exe"

    As for starting and stopping Autohotkey, I am not familiar with this app, but I am sure you will find help in its own very good forum

    http://www.autohotkey.com/forum

    Just a thought... can't you run the game from the autohotkey script?


    twicedead

      Topic Starter


      Newbie

      Re: Wacky Question with Batch files.
      « Reply #2 on: December 23, 2009, 02:32:24 AM »
      hey thanks for the reply!
      yes i could, but i have no other use for autohotkey other than making this game manageable, although it is a very good idea, i'll look into it!

      Salmon Trout

      • Guest
      Re: Wacky Question with Batch files.
      « Reply #3 on: December 23, 2009, 02:37:26 AM »
      I use another Windows automation tool, Autoit, and I often start apps from within scripts so that when the app finishes control is returned to the script, and when the script finishes and exits, it returns control to the batch script.