I've tried to implement this code but unfortunately Nothing Happens when I click the button: Play example.
Here's my code:
<script language="Javascript" type="text/javascript">
var wshShell = new ActiveXObject('WScript.Shell');
</script>
My PHP code includes:
echo "<input id='btnExplore' type='button' value='Play example'
onclick='wshShell.Run('C:\\tools\\Play Example.bat');";
The Clipboard holds the correct adress to the source to play, like C:\tools\example.avi
I really would appreciate a comment from any of you.
Cheers, Torbjorn
I've tried to implement this code but unfortunately Nothing Happens when I click the button: Play example.
Here's my code:
<script language="Javascript" type="text/javascript">
var wshShell = new ActiveXObject('WScript.Shell');
</script>
My PHP code includes:
echo "<input id='btnExplore' type='button' value='Play example'
onclick='wshShell.Run('C:\\tools\\Play Example.bat');";
The Clipboard holds the correct adress to the source to play, like C:\tools\example.avi
I really would appreciate a comment from any of you.
Cheers, Torbjorn
Share Improve this question asked Mar 20 at 22:24 user3437733user3437733 13 bronze badges 3- 1 When you write PHP that unconditionally sends a static of HTML and JS to the browser, the PHP is entirely irrelevant. – Quentin Commented Mar 20 at 23:00
- 1 Are you testing this in a browser that you know supports ActiveX? – Quentin Commented Mar 20 at 23:01
- "Nothing Happens when I click the button" — Nothing? Have you looked at the console in the browser's developer tools to see if there are any error messages displayed? – Quentin Commented Mar 21 at 16:40
1 Answer
Reset to default 0ActiveXObject is very Microsoft-specific and only available in older, pre-Edge browsers. If it is, it's disabled by default due to security concerns. Imagine you load a website and it executes some command on the command line (e.g., delete all files).