mIRC Homepage
Posted By: NightChillz run... - 12/06/03 01:15 AM
/run [-np] <filename> [parameters]
Runs the specified program with parameters.

The -n switch minimizes the window of the application being run.
The -p switch sets the working path to the path of the application being run.

You can enclose the filename or parameters in quotes if you need to. If you specify a non-executable file, mIRC tries to open it with the application associated with that file.



Inparticularly: If you specify a non-executable file, mIRC tries to open it with the application associated with that file.

now for example, if i do /run path\blah.blahblah

and .blahblah doesnt have a set app associated with it, so it wont run, or anything, so.... is there a way to tell if there is a set app for that file or not, cause if i know that there is no app to run the file, then i can give the option to choose a app.

Posted By: KingTomato Re: run... - 12/06/03 01:22 AM
use a registery check. Check if the extension as an associated program or not. There is a com alias that you can sue floating on the forums somewhere. Perform a search look for "com registry", extent to all posts, make it use method "and" and search all boards >:D
Posted By: NightChillz Re: run... - 12/06/03 01:31 AM
and look for what? editflags, persistanthandler.....i have no idea what to look for that will tell me what app a file uses to open..
Posted By: Online Re: run... - 12/06/03 02:08 AM
alias getprog return $regread($+(HKCR\,$regread($+(HKCR\.,$gettok($1,-1,46),\)),\shell\open\command\))

//echo -a $getprog(file.jpg)

Returns program name in case the extension is associated with something, otherwise returns nothing. Works on Win98se.

Also, make sure your $regread doesn't prefix the returned value with 'OK' because that would break this alias.
Posted By: NightChillz Re: run... - 12/06/03 02:31 PM
yeah, i found it lastnight b4 i went to bed, (where to look in reg) ... thanks anyway....but is there a way to regread/write without using a dll or com object(using this....posted by qwerty)...i dunno, something like $regedit(path(,newvalue)) or something should be implemeted into the next version of mirc perhaps, newvalue being optional and requiring a few params.....that is, if there isnt already an internal mirc way of doing it
Posted By: NightChillz Re: run... - 12/06/03 02:34 PM
also....when you try to run a file in windows, and it doesnt have a workin app, it askes you what u want to do, and if u select "select a program from list" it gives you a list of programs you could try to use to open it with.....where would i find that "list" to give the user the option to chose a prog....
Posted By: qwerty Re: run... - 12/06/03 04:42 PM
The only way to do that with plain mirc (ie no COM or dlls) that I can think of is this:

//run -n $iif($os isin 9598ME,command,cmd) /c <filename>

Not 100% sure if it works on 95/98/ME but it probably does.
Posted By: NightChillz Re: run... - 13/06/03 12:25 AM
ok, i think it works good enough with a com object, but do you have a responce to me second question...last post, about gettin the list of files to chose from to open a file....?
Posted By: qwerty Re: run... - 13/06/03 02:32 AM
My last post was actually a reply to that (second) question; it's the only way I've found to get the "open with.." list to pop up. Since you decided to use COM objects, you could use Online's /xrun snippet (look for it in www.mircscripts.org's snippet section) instead of /run -n, mainly because it allows you to hide the cmd.exe/command.com DOS box.
© mIRC Discussion Forums