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

Author Topic: batch file error in .ini file path, not starting .exe  (Read 4182 times)

0 Members and 1 Guest are viewing this topic.

p-lopez45

    Topic Starter


    Newbie

    • Experience: Beginner
    • OS: Windows XP
    batch file error in .ini file path, not starting .exe
    « on: February 11, 2013, 12:34:12 PM »
    Hello,

    I am trying to use a batch file to read a path in an ini file and start an application. I am able to get dos to read the path until the myapplication1.00.exe. Below is what I have.

    Batch File:
    @echo off
    for /f %%a in (myapplication.ini) do set Mypath=%%a
    start %Mypath%


    myapplication.ini File:
    "\\link\share\PSO Train\My Training Folder\myapplication1.00.exe"

    This is a shared directory and I trying to make the .bat capable to work if a shortcut is created.

    Thanks,

    Salmon Trout

    • Guest
    Re: batch file error in .ini file path, not starting .exe
    « Reply #1 on: February 11, 2013, 01:56:55 PM »
    If no tokens or delims are specified by default in an options string,  FOR /F splits each data line into tokens, the default delimiters are spaces and tabs so in your example %%a is going to expand to

    "\\link\share\PSO

    This is not what you want. If you put echo %Mypath% you will see what I mean. Try with a "delims=" options string in the FOR command

    type FOR /? at the prompt to see the documentation