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

Author Topic: Batch file question  (Read 2146 times)

0 Members and 1 Guest are viewing this topic.

tmitch

  • Guest
Batch file question
« on: January 15, 2007, 10:04:24 AM »
Two questions actually:

-- I am calling an external executable from a batch file.  This program calls another executable by relative file name, and assumes that the path to the executable is in the PATH variable.  Because this application is run by several users on various computers, I need for my batch file to verify that the path to this application is part of the PATH variable.  Is there a way to read the PATH variable, and append a value to it if it doesn't already exist?

-- The same executable runs some processes and then returns control to my batch file.  Is there a way for the batch file to check the return value of this executable, so I can stop processing if it encounters errors?

Thanks
Tim

viking



    Adviser
  • miaow-miaow 2.0 for networks
  • Thanked: 1
    Re: Batch file question
    « Reply #1 on: January 16, 2007, 01:43:10 AM »
    set path
    I don't know how to help you at augmenting the path variable (I don't know those IF instructions, I don't have experience with advanced bat files). The same applies for your second ask.
    My question: why use a bat file for these operations, when it is much more "simple" to create a small executable or script to do exactly what you need to do? Probably you want to learn to create batch files, advanced mode...

    But that's just my opinion.