PDA

View Full Version : How to enable user name and password in remote desktop



hiwendyto
06-20-2016, 05:58 AM
Hi, I want to connect Remote Machine by using VBA. However, I found that my below coding cannot pass the username and password to the pop up window(Attached pic please find). Can anyone give me some advice about my coding?



Sub remote()

'passing host name
RDPWindow = Shell("C:\windows\system32\mstsc.exe /admin /v:" & "hostname", 1)

'passing user name
RDPWindow = Shell("C:\windows\system32\mstsc.exe /admin /u:" & "username", 1)

'passing password
RDPWindow = Shell("C:\windows\system32\mstsc.exe /admin /p:" & "password", 1)

End Sub