Skip to content
General IRCX

Windows Directory

A TG007 community discussion started by takaharu_.

Discussion 3 posts
Page 1 of 1
Open
Topic #10084 · 3 published posts · 1,904 views

Is it possible to find out the Windows directory (ie: %windir%) using mIRC? I did find one snippet on MS org that uses com objects to access the registry but it doesn't seem to work (tested with XP).

I'm working on a small script that automatically opens up an installation to make it easier for someone to install a particular program on their own and the only thing left is to find out what drive letter program files are installed on. Windows has been installed before on another hard drive so there's more than one Program Files and Windows folder.

I'm using mIRC 6.16 as it can be opened straight from a CD.

I don't get paid to know the answer, therefore I'm far more likely to give you a straight and honest answer.

This was part of an alias that hixxy helped me with...

Hopefully you can work it out from that...

 

alias listfonts {
...
  if ($com(fonts)) .comclose fonts
  .comopen fonts WScript.Shell
  if (!$comerr) { .echo -q $com(fonts,ExpandEnvironmentStrings,3,bstr,$+(%,windir%)) | var %d = $+($com(fonts).result,\Fonts\) | .comclose fonts }
...
}

In the end I bypassed the problem as one hard drive had Vista, one was named "Setup Data" and the other has XP on it; I just used:

var %c = C:
:retry
if (($exists(%c $+ \users)) || (setup isin $disc(%c).label)) {
if (%c == C:) { var %c = D: | goto retry }
...
}

It worked in the end.

I don't get paid to know the answer, therefore I'm far more likely to give you a straight and honest answer.