0

I am trying to open a file on a remote computer. The computer I am trying to access has a Domain/Username/Password that are required. I am unable to find out how to use the credentials to access the file.

I don't have much, but I have this so far.

    Dim username = "domain\username"
    Dim Pass = "password "
    Dim path As String = "\\" & FIP & "\C$\Test.log "
    Process.Start(path)

I cannot figure out how to incorporate the username/pass into the path to run it.

dwb
  • 475
  • 6
  • 31
  • Is this winforms? Please tag it properly – Techie Nov 25 '15 at 17:11
  • 1
    Possible duplicate of [How do I access a network drive through the usual System.IO classes?](http://stackoverflow.com/questions/2352197/how-do-i-access-a-network-drive-through-the-usual-system-io-classes) – Alex K. Nov 25 '15 at 17:14
  • What is unique about this? Is this through FTP or just a standard share on another computer within your network and you need to connect with a user other than the one you are logged on with?? Please provide more info. – Steve Nov 25 '15 at 17:17

1 Answers1

0

You need to initialize ProcessStartInfo object and pass that as parameter to Process.start.

Dim path As String = "\\" & FIP & "\C$\Test.log "
Dim RemoteMachine As New ProcessStartInfo(path)
RemoteMachine.UserName = "domain\username"
RemoteMachine.Password = "password"
Process.Start(RemoteMachine)
Maertin
  • 384
  • 1
  • 8