It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming HTML Forum

HTML – “ Run Program File ‘if cannot find’ Run URL ”

HTML – “ Run Program File ‘if cannot find’ Run URL ”

Postby martydunn on Mon Jul 18, 2011 1:44 pm

HTML Script – “ Run Program File ‘if cannot find’ Run URL ”

I’ve just started learning HTML. I’ve tried to write some script, its not working. Could anyone please help me correct it. Thank you.

Program File: HomeChannelTV.exe
URL: www.homechannel.tv/welcome

SCRIPT

<html>
<head>
<script type="text/javascript" language="javascript">
{
function Runfile() {
WshShell = new ActiveXObject("WScript.Shell")
WshShell.Run("C:\Program Files\HomeChannelTV.exe", 1, false);
}

<else>

<meta http-equiv="refresh" content="2;
URL=http://www.homechannel.tv/welcome.htm">
<meta name="keywords" content="automatic redirection">

}
</script>
</head>
<body>
</body>
</html>
martydunn
 
Posts: 1
Joined: Mon Jul 18, 2011 11:38 am

Re: HTML – “ Run Program File ‘if cannot find’ Run URL ”

Postby rajmv on Sun Jul 24, 2011 4:12 pm

I came up with this, but still can't get it to run, not even in IE9..

Code: Select all
<html>
<head>
<script type="text/javascript" language="javascript">
   function Runfile() {
      var program = "C:\Program Files\HomeChannelTV.exe"
      var WshShell = new ActiveXObject("WScript.Shell")
      var success = WshShell && WshShell.Run(program, 1, false);
      if (success) {
         document.getElementById('notifier').innerHTML = 'now started '+program;
      } else {
         document.location = 'http://www.homechannel.tv/welcome.htm';
      }
   }
</script>
</head>
<body onload="nPad()">
   <div id="notifier">Attempting to start program</div>
</body>
</html>
rajmv
100+ Club
 
Posts: 103
Joined: Thu Jul 14, 2011 7:22 am


Who is online

Users browsing this forum: No registered users and 5 guests