1

I'm trying to use the Dir function in VBA. Something like

file = Dir("\\pca410\c$\Automation\CoaqLog\")

The problem is the folder that I'm trying to access is protected with username and password. I can manually access the folder by input username and password in the prompt window. Is there a way that I can include those information with the Dir function? Searched everywhere with no luck. Thank you.

Online search with no luck

Qiang Gu
  • 11
  • 1
  • 2
    Mapping a network drive with the FSO is simplest: https://stackoverflow.com/questions/631401/access-network-share-from-within-vbscript-eg-filesystemobject/631540#631540 – Alex K. Jan 05 '23 at 15:44
  • This will apply https://stackoverflow.com/questions/10831515/pass-a-username-password-when-accessing-a-folder-via-vbscript – wrbp Jan 06 '23 at 03:19

0 Answers0