1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Simple Batch File Issue

Discussion in 'Windows XP' started by jpboyrox, Dec 28, 2010.

Thread Status:
Not open for further replies.
Advertisement
  1. jpboyrox

    jpboyrox Thread Starter

    Joined:
    Nov 22, 2009
    Messages:
    344
    For some reason my batch file will not pass the lines
    Code:
    "D:\Users\Josh\Desktop\Josh's Documents\Computers\Misc\Common AutoHotkey Shortcuts\PS Create Shadow.ahk"
    or
    Code:
    "C:\Programs\Adobe\Adobe Photoshop CS5\Photoshop.exe"
    until these applications are closed. This is completely useless as the whole point of the batch file is to open these programs simultaneously. The whole thing is really simple and I am at a beginner's level to it all. The file is:
    Code:
    "D:\Users\Josh\Desktop\Josh's Documents\Computers\Misc\Common AutoHotkey Shortcuts\PS Create Shadow.ahk"
    "C:\Programs\Adobe\Adobe Photoshop CS5\Photoshop.exe"
    close
     
  2. surferdude2

    surferdude2

    Joined:
    Jul 6, 2010
    Messages:
    619
    You can't do multiple program opening command lines without giving it some help getting over the inherent pause. Here's what I use for starting up multiple programs:

    Code:
    ::Use the following script to open multiple programs from a batch file.
    :: Substituting your own desired software path commands.
    :: This batch must be located on a PATH location to work properly.
    ::The START command overcomes the pause that occurs when opening
    ::programs with a simple command line.
    ::The double quotes ("") makes it possible to use a command path that
    ::requires enclosure in quotes without confusing the START command
    ::and having it treat it as the "title" switch for the command.
    ::The CHOICE command provides a time delay between commands.
    ::Delete it if not needed or add higher amount to the number to get more
    ::seconds delay.  The ÿ character is made by holding alt and keying 0255
    ::on the numeric keypad, then releasing the alt key.
    ::XP does not have the CHOICE command but you can get it from an older
    ::version of Windows or download it from the Internet for free.  Place it in
    ::the System32 folder.
    ::
    START "" "C:\Program Files\Microsoft Office\Office\WINWORD.EXE"
    CHOICE /c:ÿ /t:ÿ,5 /n
    START "" "C:\Documents and Settings\Owner\My Documents\Qpw\TIMELINE.WB2"
    CHOICE /c:ÿ /t:ÿ,5 /n
    START "" "C:\Program Files\Microsoft Works\WksWP.exe"
    You can modify that scropt as needed to fit your requirements.
     
  3. Soundy

    Soundy

    Joined:
    Feb 17, 2006
    Messages:
    1,838
    This is the intended behaviour, allowing you to call outside programs or procedures sequentially.

    Try adding the START command:
    Code:
    START "D:\Users\Josh\Desktop\Josh's Documents\Computers\Misc\Common AutoHotkey Shortcuts\PS Create Shadow.ahk"
    START "C:\Programs\Adobe\Adobe Photoshop CS5\Photoshop.exe"
    
    Type HELP START at a command line for a list of parameters.
     
  4. jpboyrox

    jpboyrox Thread Starter

    Joined:
    Nov 22, 2009
    Messages:
    344
    okay, your way seemed unnecessarily complicated as simply
    START "" "C:\Program Files\Microsoft Office\Office\WINWORD.EXE"
    on each program worked for me fine. Thanks a lot!
     
  5. surferdude2

    surferdude2

    Joined:
    Jul 6, 2010
    Messages:
    619
    I agree, the version I posted is more complex but you may yet find use for it upon occasion. It is able to handle some direct access problems that involve file association startups that the simpler version can't handle.

    Thanks for the feedback.
     
  6. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/971271

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice