1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

Cannot use relative path [in batch file]

Discussion in 'Windows XP' started by instanton, 2006/05/31.

  1. 2006/05/31
    instanton

    instanton Inactive Thread Starter

    Joined:
    2005/05/06
    Messages:
    16
    Likes Received:
    0
    For some reason I need to write some program which launches another executable in a subdirectory of the current folder. The use of a relative path is crucial for my purpose. Trying this on the command line works OK:

    .\mysubfolder\myexe.exe

    However, putting the above line into a batch fille and running the batch does NOT work! Doing similar things in a VB program doesn't work either, and in the VB generated exe I found the following error message:

    Runtime error 53: file not found.

    On other mechines to which I have access there is no such problems. Does anyone know what's happening on my machine? (The problemic machine and the other comparing machines are all running Winxp Pro with SP2) Thanks.
     
  2. 2006/05/31
    ephemarial

    ephemarial Well-Known Member

    Joined:
    2002/02/26
    Messages:
    426
    Likes Received:
    27
    From error msg- have you tried entering path STARTING from Hard Drive letter?
    Realize this isn't relative directory.
    But you also don't know what directory windows is starting from.
    So need some consitency somewhere for batch to find the program.

    C:\______ \mysubfolder\myexe.exe

    For troubleshooting.
    Try getting the full path name of ?.exe on your computer.
    Get it on other computers.
    Find out what directory windows is openinig when executing batch. Just a cmd run n look at prompt will do.
    AND that will vary depending on what program run last.

    You're assuming windows will open batch in starting from mysubfolder
     
    Last edited: 2006/05/31

  3. to hide this advert.

  4. 2006/05/31
    instanton

    instanton Inactive Thread Starter

    Joined:
    2005/05/06
    Messages:
    16
    Likes Received:
    0
    Thanks a lot. I think I got the reason for the problem. I used to use xplorer2 Lite as a replacement of windows explorer. In the options of xplorer2 lite, there is an option "do not lock the current folder ". If this option is unchecked, there is no such problem any more.
     

Share This Page

  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.