No announcement yet.

Does a file exist?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Does a file exist?

    I’m using XP and PB 3.5 and all is working just fine except for.

    ‘C:\Program Files’ exists with a whole host of sub-folders.

    Sub-folder ‘C:\Program Files\AA’ exists or it does not exist,
    have no preference.

    If sub-folder ‘C:\Program Files\AA’ does not exist then
    I want my software to determine that.

    If sub-folder ‘C:\Program Files\AA’ does exist then
    I want my software to determine that and
    if program ‘C:\Program Files\AA\BB.exe exists.

    The problem that I’m having is ‘Program Files’ with
    a space and length not following the Dos rules.

    A gentle push/hint/code/suggestion will be most appreciated.

    Thank, Jack


  • #2
    PB/DOS can't digest file names with a space in it. It can only
    handle 8x3 file names.

    You will have to determine what the short file name is and go
    from there.

    When the SFN is determined, check the DIR$ function. That will
    tell you if the file/folder exists.

    There are no atheists in a fox hole or the morning of a math test.
    If my flag offends you, I'll help you pack.


    • #3
      Just did a 'F3' in PB editor, kept scrolling until the
      root directory appears and here is 'Progra~1'. Looks like the
      SFN to me, gave it a try, works like a charm.

      Thanks for the suggestion in just a minute or two.