mIRC Home    About    Download    Register    News    Help

Print Thread
#155158 04/08/06 02:59 AM
Joined: Jul 2006
Posts: 4,145
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
When i want to open file whitch don't have extention ( like hashtable ) and dont have the application associated ( for switch -p )
mIRC says for exemple : * /run: unable to open 'jeu\ident'

Can we have a switch like -c which show us the dialog for choose a program ? smile

#155159 06/08/06 10:02 AM
Joined: Feb 2005
Posts: 342
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
Maybe you should just try:

//run notepad $qt($$sfile($mircdir))

This will open a file in notepad for you.

Code:
alias prun {
  var %file = $iif($isfile($1-),$1-,$$sfile($mircdir,Select a file.))
  run -p %file
}


You can use this to /prun, and select a file (these need extensions)

Code:
alias notepad {
  var %file = $iif($isfile($1-),$1-,$$sfile($mircdir,Select a file.))
  run notepad $qt(%file)
}


And you can use /notepad, to select a file as well (doesn't need an extension).

Last edited by Rand; 06/08/06 10:10 AM.
#155160 08/08/06 01:47 AM
Joined: Jul 2006
Posts: 4,145
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
And if i don't want to use notepad?
I know i can make alias for a file using notepad.

#155161 08/08/06 06:01 AM
Joined: Feb 2005
Posts: 342
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
Alright, I'm assuming you've missed the point. You're asking for a -c that allows you to select which program to run a file with, right? Or do you mean the windows default "select the program" ?

The reason your "error" occurs is because there is no set program to open up files that have no extension. I'm sure you're aware of this.

You can change "notepad" to almost any program name to open the program.

You can also write a script to select the program to open it with as well..

Code:
alias xrun {
  var %openwith = $qt($$sfile($mircdir)) , %run = $qt($iif($1-,$1-,$$sfile($mircdir)))
  run %openwith %run
}


/xrun, this will ask you for a program to run the file, and then the program to be ran.

/xrun c:\somethingspecial.txt, this will just pop up a window asking you what you'd like to use to open the file.

I guess a -c to force windows to let you choose which program to open it with would be cool. *shrug*

Edit: With a little googling, I have figured out how to do it. :P

Code:
alias _run {
  run rundll32.exe SHELL32.DLL,OpenAs_RunDLL $1-
}


I didn't do anything spiffy with this alias. However, you will need to use the full path of the file, OR the file must be in your mIRC dir. Doing a /_run theme\picture.jpg, will pop up the window, but it won't actually show you the file once you select what to run it with.

/_run C:\blah\blah blah\blue

Last edited by Rand; 08/08/06 06:17 AM.

Link Copied to Clipboard