Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script needed to open RDP connection

Status
Not open for further replies.

Richo1980

Programmer
Apr 12, 2006
27
AU
Hi all,

Quick (and I'm sure easy) question

I have the following script.

Code:
<script>
function Launch_TSC(strServer) {
	var strServer
	var strTSCpath = "C:\\windows\\system32\\mstsc.exe /v:"
	var ws = new ActiveXObject("WScript.Shell");
 	ws.Exec(strTSCpath + strServer);
}
</script>

I then use the following code to open an RDP session to a server (strServer) as well as offering a link to a bat file to see who is currently using a session on that server (if required)

Code:
<td width='20%'><b><font face="Arial"><input type='button' style='width:150px;' value='Server1' onClick='Launch_TSC("Server1.domain.com")'> <input type='button' value='?' onClick='Check_TSC("Server1.domain.com")'></font></b></td>

This works fine, however when the RDP session is establised I have to fill out Username/Password/Domain...I have .RDP files already created that have this information in them and what I would like to do is create a script that can call these files directly...

I realise I could just use a href but was wondering if a script could be written?

Can anyone offer any suggestions?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top