mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2003
Posts: 2,812
Raccoon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
Inspired by an earlier post on the Suggestions Forum... I wrote this simple File Association and mIRC Alias that work together to allow you to perform any mIRC command upon selected file(s) in Window's Explorer (your desktop).

The Registry File Association is in the form of a .reg file that you can "Merge" into the registry by double clicking or right-click > Merge.

You must open the .reg file in Notepad first to examine if the path to mirc.exe is correct, and to copy the mIRC Alias into your Aliases section (Alt+A).

Here is the link to execute_mirc_commands.reg
(Right-click and Save As, or your browser's equivalent)

- Raccoon


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Dec 2002
Posts: 117
R
Vogon poet
Offline
Vogon poet
R
Joined: Dec 2002
Posts: 117
How about this remote script instead of modifying a .reg file:
Code:
on *:load:{
  var %now = $input(Add mIRC shell extension now?,vyq,mIRC shell extension)
  if (%now == $yes) shellDDE
  echo $colour(info) -st * You can type /shellDDE to add the shell extension manually
}

;By Rich (Rich@home.nl)
;Adds registry entries for mIRC shell extension
;Syntax:
;/shellDDE
alias shellDDE {
  if ($regwrite(HKEY_CLASSES_ROOT\*\shell\Execute_mIRC_Commands\,Execute &mIRC Commands) != $ok) { echo $colour(info) -at * /shellDDE: error writing registry key HKEY_CLASSES_ROOT\*\shell\Execute_mIRC_Commands | halt }
  if ($regwrite(HKEY_CLASSES_ROOT\*\shell\Execute_mIRC_Commands\command\,$mircexe) != $ok) { echo $colour(info) -at * /shellDDE: error adding writing key HKEY_CLASSES_ROOT\*\shell\Execute_mIRC_Commands\command | halt }
  if ($regwrite(HKEY_CLASSES_ROOT\*\shell\Execute_mIRC_Commands\ddeexec\,/dde_execute $chr(37) $+ 1) != $ok) { echo $colour(info) -at * /shellDDE: error adding writing key HKEY_CLASSES_ROOT\*\shell\Execute_mIRC_Commands\ddeexec | halt }
  if ($regwrite(HKEY_CLASSES_ROOT\*\shell\Execute_mIRC_Commands\ddeexec\Application\,$ddename) != $ok) { echo $colour(info) -at * /shellDDE: error writing writing key HKEY_CLASSES_ROOT\*\shell\Execute_mIRC_Commands\ddeexec\Application | halt }
  if ($regwrite(HKEY_CLASSES_ROOT\*\shell\Execute_mIRC_Commands\ddeexec\topic\,command) != $ok) { echo $colour(info) -at * /shellDDE: error writing registry key (HKEY_CLASSES_ROOT\*\shell\Execute_mIRC_Commands\ddeexec\topic | halt }

  echo $colour(info) -qat * mIRC shell extension added!
  if (!$isdde($ddename)) {
    if ($show) !ddeserver on
    else !.ddeserver on
    echo $colour(info) -qat * mIRC's DDE server has to be enabled for this to work!
  }
}

; Script by Raccoon@EFNet/#mIRC
; Will execute the same command on multiple-selected files for up to 5 seconds,
; without prompting for a command again.  Modify -u5 flag to adjust.
alias dde_execute {
  if ( !%DDE_EXECUTE.CMD ) set -u5 %DDE_EXECUTE.CMD $input( $& 
    Enter the mIRC Command(s) to be Executed. $crlf $+ $& 
    (Use $!1- where you want the filename inserted) $&
    ,129,Execute mIRC Command(s) on Selected File(s),%DDE_EXECUTE.LAST)
  set %DDE_EXECUTE.LAST %DDE_EXECUTE.CMD
  $eval(%DDE_EXECUTE.CMD,2)
}

;By querty (/me Couldn't get it working):
; Syntax:
; $regwrite(<key>/<value>,<data>,[type])
; [type] can be
;  d, for REG_DWORD
;  b, for REG_BINARY
; anything else (or nothing) for REG_SZ
; returns $ok if the operation was successful, otherwise $false
; Example: $regwrite(HKEY_CURRENT_USER\MyKey\,This is the key's data,s)
; Example: $regwrite(HKEY_CURRENT_USER\MyKey\MyDwordValue,5,d)
alias regwrite {
  var %i = 1, %type = bstr, %3 = REG_SZ
  while ($com(wshell $+ %i)) { inc %i }
  var %name = wshell $+ %i
  .comopen %name WScript.Shell
  if ($comerr) {
    .comclose %name
    return $false
  }
  if d isin $3 { var %3 = REG_DWORD, %type = ui4 }
  elseif b isin $3 { var %3 = REG_BINARY, %type = ui4 }
  if ($com(%name,RegWrite,3,bstr,$1,%type,$2,bstr,%3) == 0) {
    .comclose %name
    return $false
  }
  .comclose %name
  return $ok
}

Somehow explorer gives an error when using it on multiple files though, haven't figured out why frown


$input(Me like stars, You too?)

Link Copied to Clipboard