Controlling Remote Desktop from VBA

  • I'm attempting to log into a remote computer (Computer B) from (Computer A) using Remote Desktop. Once in, I want to pass values from Computer A to a command line on Computer B. I've managed to obtain the code to login successfully to Computer B, but when I attempt to try and call a Shell("cmd.exe") the program opens on Computer A rather than Computer B. I'm guessing its because my RDP session no longer has focus. Is there a simple way to handle this? I've been investigating WMI but I'm a little unsure how that all works. Would appreciate some guidance. Thanks!


  • Code Tags Added
    Your post does not comply with our Forum RULES. Use code tags around code.


    Posting code between

    Code

    tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.


    Highlight your code and click the # icon at the top of your post window.


    (I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)