mIRC Homepage
Posted By: DeSync $mircdir - 18/12/10 05:36 PM
Hi,

On old good 6.2* when we install mIRC in some folder and when we do //echo $mircdir it returns same dir, but on 6.35 and newer it returns other. You know what I mean.

So is there a way to make it same folder like as in old version. Becouse if we want move script from one PC to other we got bunch of problems for loading scripts etc.

There must be some option, or you should add it.

Regards
Posted By: 5618 Re: $mircdir - 18/12/10 05:42 PM
Place the settings files, like mirc.ini, in the same directory as mirc.exe
Note that this will cause problems if you installed mIRC in Program Files under WinVista or Win7.
Posted By: DeSync Re: $mircdir - 18/12/10 05:56 PM
Yeah, if I wan't move folder I must move two folders.
Posted By: Riamus2 Re: $mircdir - 19/12/10 04:24 AM
If you have mIRC installed somewhere such as c:\mirc\ and you put mirc.ini in your mirc.exe folder as was mentioned, then you'll only have to move a single folder.

* In XP or older, you can have it in c:\program files\mirc\ without a problem, but in Vista/7, you'll have to change the default permissions if you have it installed there and place mirc.ini in the same folder.
Posted By: DeSync Re: $mircdir - 19/12/10 03:18 PM
I've found something, maybe, useful.

If I install mIRC as portable, will I get what I want?
Couse with portable, mirc.ini is stored next to mirc.exe and without portable, it's in other folder.

So if I install mIRC with portable, does it stores data to some other folder?

I guess everything is now in C:\portable

Regards
Posted By: Riamus2 Re: $mircdir - 20/12/10 12:23 AM
Portable does keep everything in one folder, but you lose some options just as using irc:// links. Also, you may still run into issues in Windows7 or Vista if you use Portable in c:\program files\.

The easiest thing if you want everything to work "normally" is to install to something like c:\mirc\ and to create a blank mirc.ini file or copy the one from your users folder and put it in the same folder as mirc.exe. Don't install as portable with this option. Just copy or make a blank mirc.ini and you're set. It will then only use that folder.

Note that this is the third time someone has said to do that. If you don't want our advice, why ask? smile
Posted By: DeSync Re: $mircdir - 20/12/10 12:25 PM
Well, I want advice, so I'm asking.

On 6.2* it was easier, everything is one folder, now we can have a bunch of problems when loading scripts.

My friend has too, and I've told thim to install like portable (Win 7) and now can load all files easy.
Posted By: westor Re: $mircdir - 20/12/10 08:01 PM
did you try to create a folder and put inside the mirc.ini and the mirc.exe create a scripts fokder put there your scripts and run the mirc.exe and load your scripts from the currently folder!
Posted By: DeSync Re: $mircdir - 20/12/10 08:25 PM
At the end, that was solved my problem. But when instaling as portable, it do same thing.
Posted By: Riamus2 Re: $mircdir - 20/12/10 09:15 PM
Originally Posted By: DeSync
But when instaling as portable, it do same thing.


Except that portable has some drawbacks as I mentioned before. Of course, those drawbacks may or may not affect you depending on whether or not you want or need those features.
Posted By: borgx Re: $mircdir - 07/01/11 06:56 PM
Originally Posted By: DeSync
At the end, that was solved my problem. But when instaling as portable, it do same thing.

Glad you got your problem worked out, but a lot of the time problems like yours can be avoided with the use of $scriptdir instead of $mircdir. With quote usage to keep directories with spaces from throwing an error or causing debug issues.

For your own (or modification of others) scripts, you can create an alias (eg _myscriptbase) in your main script file that returns $scriptdir. $script and $scriptdir have been around since 1997 when they came out in v5.0. There really is no reason to not use it and save yourself some grief.

I use the following in my scripts, with alias name changed if needed. I always use the latest version of mIRC.
Code:
/*
 eg $scriptdir == %APPDATA%\mIRC\
 $basedir = $scriptdir
 $basedir(sub folder) = $scriptdirsub folder
 $basedir(sub folder).qt = "$scriptdirsub folder"

 set %fix to $true for $mircdir/$scritdir mimic (add \ to end of %r if missing)
 set %fix to $false to keep what is passed
*/
alias basedir {
  var %fix = $true
  var %r = $iif(!$1, $scriptdir, $+($scriptdir, $1-))
  var %r = $iif(!%fix, %r, $iif($istok($chr(92) $chr(47), $right(%r, 1), 32), %r, $+(%r, $chr(92))))
  var %r = $iif($prop == qt, $qt(%r), %r)
  return %r
}
Posted By: DJ_Sol Re: $mircdir - 07/01/11 10:15 PM
Just put mirc.ini in your script folder and it will be fine.

Originally Posted By: mIRC Help File
$mircdir

Returns the directory where mIRC stores its settings, such as mirc.ini, and other files and folders.

© mIRC Discussion Forums