VB: Keep only the filename without the path.

Solved
Anonyme209 Posted messages 761 Status Member -  
Anonyme209 Posted messages 761 Status Member -
Hello,

I am looking, in Visual Basic 2010, to retrieve only the file name from a file path. I thought about removing everything before the last "\\" but I don't know how to do that.

Thank you for your help.

2 answers

  1. Patrice33740 Posted messages 8400 Registration date   Status Member Last intervention   1 784
     
    Hello,

    try:
     NomCourtFichier = CreateObject("Scripting.FileSystemObject").GetFileName(nomCompletFichier)


    --
    Best regards
    Patrice
    6
  2. Anonyme209 Posted messages 761 Status Member 19
     
    Thank you very much, that works.
    I'm closing the topic.
    0