CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 1999
    Location
    Israel
    Posts
    140

    Serach file according to path

    My exe file is reside in a directory such
    as "v:\mp\ae\exe\ae.exe" and I have a log file in
    "v:\mp\ae\resources\log\ae.log"

    In the customer site there is no "V:\" directory
    how can I tell my application to find the log file
    in "\\\resources\log\ae.log"
    Please help
    Thanks sigal


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: Serach file according to path

    not sure, if I understand your problem, but,
    if your exe resides in "\mp\ae\exe\"
    and you want to access a file in "\mp\ae\resource\log"
    try this:

    dim strDir as string
    strDir = app.path
    chdir app.path
    ' change to logfile dir
    chdir "..\..\resources\log"
    strLogDir = curdir
    open curdir & "\ae.log" for output as #hFile





  3. #3
    Join Date
    Jul 1999
    Location
    Athens, Hellas
    Posts
    769

    Re: Serach file according to path

    Try to use the FileSystemObject:
    Set a reference to your project:
    Microsoft Scripting Runtime

    add this code:


    dim fso as FileSystemObject
    set fso = new FileSystemObject




    Then, write "fso." At the time you press the ".",
    a list with all properties, methods will appear, I believe you will find there what you need. I cannot remember exactly the property name that you need. Good luck!

    Michael Vlastos
    Automation Engineer
    Company SouthGate Hellas SA
    Development Department
    Athens, Greece

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured