I've spent the better part of the afternoon trying to figure this out. I have to upload a file to a connected computer via Remote Desktop Connection using a Script Written in VBSCript. I was going to use FTP, but found out that I can't.
Right now I have
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFile "C:\blahdiddyblah\blahdiddy.zip", "fubar.networkname.blah.com\directory
When I run this I get a bad login or password error I understand this is because it doesn't give me a way to login to remote desktop before it tries the upload.
I've tried something something similar to what's below, except with the password included as part of the string, in that case it throws a "path not found" error.
Option Explicit
Dim sComputer, sUsername
sComputer = InputBox("Please enter the Computer Name or IP")
sUsername = InputBox("Please Enter the Users Login ID")
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFile "\\servername\path\servers.lst" _
, "\\" & sComputer & "\c$\Documents and Settings\" & sUsername & "\Local Settings
OK, so what I've done here is use the net use command from windows which makes the Remote Desktop Connection, and basically wrap it in VBScript.
//Allow Sleep while connection is made, otherwise it will fail because it has not had the opportunity to login yet.
//Make sure you have admin rights for the folder, and it is shared. This means right click, and going into Sharing Options in windows.