VB Code:
  1. If Dir(Infile) = "" Then    'Checking scanhold.dat exists or not
  2.         Msg = Infile & " does not exist."
  3.     Else
  4.         Mydate = Format(Date, "YYMMDD")
  5.         Mytime = Format(Time, "HHMMSS")
  6.         NewName = "\\sapt01\KPIINTERFACE\pbl\in\" & PlantName & strPreFix & Mydate & Mytime & ".txt"
  7.         Name Infile As NewName 'Cut n paste
  8.         'FileCopy Infile, NewName 'copy n paste
  9.         Msg = Infile & " has changed name to " & PlantName & strPreFix & Mydate & Mytime & ".txt"
  10.     End If
  11.     MsgBox Msg

i used this code to copy a file from one destination to other..but the destination folder (\\sapt01\KPIINTERFACE\pbl\in\) need a password to open it. this will cause failed to open path in my program. how to set a password to open a locked folder?