• 0

How To Call a Local Program in a Webpage


Question

ok heres my question ?i have this line of code to call mirc ?but heres the catch, it has the -portable switch after it.

my issue is that im getting the error like you would in the normal shortcut properties if you had the quotes int he wrong place or not at all.

line of code is like this:

<A HREF="java script:;" TARGET="_self" ONCLICK=" ShellExJ('D:/Portable Programs/mIRC/Mirc.exe -portable')">mIRC</A><BR>

when i click it i get this error:

errorbg1.png

if i make the path look like this:?('"D:/Portable Programs/mIRC/Mirc.exe" -portable') ?it wont work and in notepad2 the path turns red indicating it wont work or soemthing.

11 answers to this question

Recommended Posts

  • 0
  The_Decryptor said:
ShellExJ('D:\\Portable Programs\\mIRC\\Mirc.exe', '-portable')

Will work apparently, according to one source.

I have no idea where this function is defined, but it seems to be an IE only thing or something.

thanks for the reply. unfortunately one problem. ?the link will work to start the program but the ?'-portable' switch ?gets ignored:(?:(

  • 0

Whatever you find that supports this functionality will likely not work on any extended basis.

You would either:

A: Need to create a new shortcut or script that would then in turn run mIRC as you want it.

B: Need to pass mIRC a file from the the web page that would run mIRC as you want.

You do not get to pass arguments to applications on the local system. That's a road to interesting badness.

  • 0

Do you have any more javascript code, like where you define the function ShellExJ?

Edit: try this

function ShellExJ(cmd,params) {
  var oShell = new ActiveXObject("Shell.Application");
  oShell.ShellExecute(cmd, params,"", "open", "1");
}

Edited by Code.Red
  • 0

hey i figured something out to get this to work using nircmd.exe.

the line looks like this now:

<A HREF="java script:;" TARGET="_self" ONCLICK=" ShellExJ('D:/Portable Programs/mIRC/DesktopShortcut')">mIRC</A><BR>

DesktopShortcut is a link using nircmd to a .bat file containing the commandline.

nircmd shortcut command:

"D:\Portable Programs\mIRC\nircmd.exe" exec hide "mirc.bat"

i tried using the .lnk extension for DesktopShortcut but it didnt work for some reason. this is the way it works so im going with it :D

dunno why i didnt think of the nircmd program before but it really is a great commandline tool if youve not used it yet

Edited by john0877
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.