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!

RDP Shortcut using Java

Status
Not open for further replies.

hydruid

Programmer
Feb 5, 2008
103
US
What I've been looking for and not having any luck is finding java code that when browsed to automatically redirects the user to run mstsc.exe locally or with a shortcuut.

A big part of my problem is that I'm not familiar with java, maybe I am looking for the wrong terms.

I do not however want to go to a website and click a button, I want you to be automatically redirected to the rdp link when browsing to the page.

Correctly asked questions will receive a better answer.
 
There is no Java in JavaScript, like no Dog in Hotdog :)
 
Ok I apologize for not being clear. I would like javascript to do this for me, not java lol

Correctly asked questions will receive a better answer.
 
How ironic, given your signature :)

Does this have to work cross-browser, or is IE-only OK? I ask as you can probably run executables using some ActiveX control, but cross-browser or cross-OS, I'm not so sure...

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Maybe I should read my signature more often, lol might help me ask better questions.

In the end I want it to be cross browser but for now IE and windows would be good.

Correctly asked questions will receive a better answer.
 
found this code: tried it but it doesn't work:

<a href="javascript:LaunchApp(1)">

<img border="0" id="img1" src="../images/button1F10.jpg" height="24" width="120" alt="SERVER1" fp-style="fp-btn: Soft Rectangle 5" fp-title="SERVER1" onmouseover="FP_swapImg(1,0,/*id*/'img1',/*url*/'../images/button337.jpg')" onmouseout="FP_swapImg(0,0,/*id*/'img1',/*url*/'../images/button1F10.jpg')" onmousedown="FP_swapImg(1,0,/*id*/'img1',/*url*/'../images/button338.jpg')"

onmouseup="FP_swapImg(0,0,/*id*/'img1',/*url*/'../images/button337.jpg')"></a>



</a></td>

<a href="javascript:LaunchApp(2)">

<img border="0" id="img6" src="../images/button8D1.jpg" height="24" width="120" alt="SERVER2" onmouseover="FP_swapImg(1,0,/*id*/'img6',/*url*/'../images/button8E1.jpg')" onmouseout="FP_swapImg(0,0,/*id*/'img6',/*url*/'../images/button8D1.jpg')" onmousedown="FP_swapImg(1,0,/*id*/'img6',/*url*/'../images/button8F.jpg')"

onmouseup="FP_swapImg(0,0,/*id*/'img6',/*url*/'../images/button8E1.jpg')" fp-style="fp-btn: Soft Rectangle 5" fp-title="SERVER2"></a></td>





<script type="text/javascript">

function LaunchApp(server) {

if (!document.all) {

alert ("Available only with Internet Explorer.");

return;

}

var ws = new ActiveXObject("WScript.Shell");

ws.Exec("C:\\Windows\\System32\\mstsc.exe /v:SERVER"+server);

}

</script>

Correctly asked questions will receive a better answer.
 
Looks like a bit of old FrontPage code. I've never used it, but I suspect there will be some framework code somewhere that you're missing.

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
 
yea that was just one example that I found.

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

Part and Inventory Search

Sponsor

Back
Top