mIRC Home    About    Download    Register    News    Help

Print Thread
$windir and $sysdir for locating system dlls etc #89592 08/07/04 02:01 PM
Joined: Sep 2003
Posts: 1
Z
zeroid Offline OP
Mostly harmless
OP Offline
Mostly harmless
Z
Joined: Sep 2003
Posts: 1
i just saw that they added /drawpic -o but if you want to draw an icon from a dll you have to do this (win98)

Code:
//window -ap @test | /drawpic -o @test 10 10 3 c:\windows\system\shell32.dll


but this only works on windows 98 because the location of shell32.dll is different on different versions of windows

so it would be cool to locate a dll by using something like this
Code:
 $sysdir $+ shell32.dll



Re: $windir and $sysdir for locating system dlls etc #89593 08/07/04 02:30 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
These can be scripted with the help of COM objects:
Code:
alias specialdir {
  if $findtok(win sys temp,$1,32) { var %a = sd $+ $ticks, %b = %a $+ d, %c = $ifmatch - 1 }
  else return
  .comopen %a Scripting.FileSystemObject
  if $comerr { return <error> }
  .comclose %a $com(%a,GetSpecialFolder,1,uint,%c,dispatch* %b) $com(%b,Path,2)
  %a = $com(%b).result
  .comclose %b
  return %a
}
Use
$specialdir(win) for the windows folder
$specialdir(sys) for the system folder
$specialdir(temp) for the Temp folder

Last edited by qwerty; 08/07/04 02:32 PM.

/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: $windir and $sysdir for locating system dlls etc #89594 08/07/04 03:47 PM
Joined: Dec 2002
Posts: 788
C
Coolkill Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
A less intensive solution might be to just $findfile().

Eamonn.

Re: $windir and $sysdir for locating system dlls etc #89595 08/07/04 04:04 PM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Less intensive? Hardly. A comobject accessing an enviornmental variable is much more proficient than find file, in many repects.


-KingTomato