|
|
Joined: Dec 2002
Posts: 271
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 271 |
/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.
|
|
|
|
Joined: Jan 2003
Posts: 3,012
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 3,012 |
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
-KingTomato
|
|
|
|
Joined: Dec 2002
Posts: 271
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 271 |
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..
|
|
|
|
Joined: Dec 2002
Posts: 1,922
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,922 |
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.
|
|
|
|
Joined: Dec 2002
Posts: 271
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 271 |
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
|
|
|
|
Joined: Dec 2002
Posts: 271
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 271 |
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....
|
|
|
|
Joined: Jan 2003
Posts: 2,523
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 2,523 |
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.
/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
|
|
|
|
Joined: Dec 2002
Posts: 271
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 271 |
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....?
|
|
|
|
Joined: Jan 2003
Posts: 2,523
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 2,523 |
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.
/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
|
|
|
|
|
|