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!

Why doesn't this work? (Very short javascript)

Status
Not open for further replies.

hydruid

Programmer
Feb 5, 2008
103
US
<script language="javascript">
function setip(ip)
{
var wshell;
wshell=new ActiveXObject("WScript.Shell");
wshell.Run("C:\\windows\\system32\\mstsc.exe /v:"+ip);
}
</script>
<body>
<a href="#" onclick="javascript:setip('192.20.31.1')"> RDP </a>
</body>

Just gives me an error when i try to run it.

Correctly asked questions will receive a better answer.
 
Have you tried:
<a href="#" onclick="setip('192.20.31.1');"> RDP </a>


Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
nope same thing

Correctly asked questions will receive a better answer.
 
Can you ping 192.20.31.1 from the machine you are running this on? It sounds as this may be a local IP address.

If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
the 192 address is not the real address I'm using, I'm using a public IP 65.x.x.x and I can rdp into it when I'm using the remote desktop client manually

Correctly asked questions will receive a better answer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top