Author Topic: VB copy file issue. Not ahmi specific  (Read 1468 times)

g.mccormick

  • Newbie
  • *
  • Posts: 29
    • View Profile
VB copy file issue. Not ahmi specific
« on: October 01, 2020, 11:40:00 AM »
This is not a ahmi specific question, but I am attempting to copy a log file to a destination.  I get an error for the path, but I cannot figure out what the issue is.  Any help would be appreciated.
See pic

georgegraz

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: VB copy file issue. Not ahmi specific
« Reply #1 on: October 01, 2020, 03:19:24 PM »
Can't see filename, but my problem a couple of weeks ago is this:
g:\_Filename.csv   didn't work
g:\Filename.csv does
George

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: VB copy file issue. Not ahmi specific
« Reply #2 on: October 01, 2020, 04:12:42 PM »

   My.Computer.FileSystem.CopyFile(foundFile, My.Computer.FileSystem.SpecialDirectories.Desktop & foundFile.Substring(foundFile.LastIndexOf("\")))

g.mccormick

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: VB copy file issue. Not ahmi specific
« Reply #3 on: October 01, 2020, 05:16:12 PM »

   My.Computer.FileSystem.CopyFile(foundFile, My.Computer.FileSystem.SpecialDirectories.Desktop & foundFile.Substring(foundFile.LastIndexOf("\")))

Thank you Godra.  That worked perfectly. Can you explain the what/why? 

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: VB copy file issue. Not ahmi specific
« Reply #4 on: October 01, 2020, 05:25:22 PM »
Look at the bottom left of your picture. It shows the "foundFile" value as the whole path and not only the file name.