none
File path with a semi-colon in it. RRS feed

  • Question

  • Hi,

    I am wondering if anyone could advise me whether there is a way to ignore an escape character, e.g. semi-colon in a file path when I am trying to get a list of all the files in a directory. I get the DirectoryNotFoundException exception.

    So if the path is I:\All I can see is; you\, when you use any directory classes, file listing you only get is I:\All I can see is. It stops at the semi-colon. I see many mentions of this problem but not solution for VB users. I thought I could read character by character but VB does not see anything after the semi-colon.

    Has anyone any suggestions please?

    Thanks.

    Alastair

    Friday, July 31, 2020 3:12 PM

Answers

  • It seems that DirectoryInfo.GetDirectories correctly returns full names in case of ‘;’.

    Show your code that reproduces the problem.


    Friday, July 31, 2020 5:19 PM

All replies

  • It seems that DirectoryInfo.GetDirectories correctly returns full names in case of ‘;’.

    Show your code that reproduces the problem.


    Friday, July 31, 2020 5:19 PM
  • Viorel_

    Thanks for the reply. I was working in VBscript at work and it did not work, but when I came home and tried in VB.NET it did. Apologies for the confusion and thanks for the reply.

    Cheers.

    Alastair

    Saturday, August 1, 2020 10:51 PM