0

I have this little script, that starts RealVNC viewer. This works fine, but I would like to send a variable to function. So the vncviewer.exe should start with for instance:
vncviewer.exe LT123456

I am a complete noob when it comes to javascripting and it is probably super simple. But I am stuck.

How do I send the variable from the button and how can I process the variable in the javascript?

This will become a button in a table with mulitple rows by the way. The variables will be parsed from a MySQL Database.

This is the script which now only starts the vncviewer.exe:

<script language="JavaScript" type="text/javascript">  
MyObject = new ActiveXObject( "WScript.Shell" )  
function RunVNCViewer() {  
    MyObject.Run("vncviewer.exe") ;  
    }  

</script> 

<button onclick="RunVNCViewer()">Run VNCViewer</button> 

Thanks a whole heap!

Regards Mike

1

1 Answer 1

0

Solved, wasn't difficult, but if you don't know too much about javascript, it's hard.

<html> 
<head> 
<script language="JavaScript" type="text/javascript">  

 MyObject = new ActiveXObject( "WScript.Shell" )  
     function RunVNCViewer(laptop_name) {  
     MyObject.Run("vncviewer.exe " + laptop_name)) ;  
     }  

</script> 
</head> 
<body> 
<h1>Run a Program</h1> 
<button onclick="RunVNCViewer('lt123456')">Run VNCViewer</button> 
</body> 
</html>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.