mIRC Home    About    Download    Register    News    Help

Print Thread
$mircdir #228334 18/12/10 05:36 PM
Joined: Jan 2008
Posts: 57
D
DeSync Offline OP
Babel fish
OP Offline
Babel fish
D
Joined: Jan 2008
Posts: 57
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

Re: $mircdir [Re: DeSync] #228335 18/12/10 05:42 PM
Joined: Jun 2007
Posts: 933
5
5618 Offline
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
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.

Re: $mircdir [Re: 5618] #228336 18/12/10 05:56 PM
Joined: Jan 2008
Posts: 57
D
DeSync Offline OP
Babel fish
OP Offline
Babel fish
D
Joined: Jan 2008
Posts: 57
Yeah, if I wan't move folder I must move two folders.

Re: $mircdir [Re: DeSync] #228343 19/12/10 04:24 AM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
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.


Invision Support
#Invision on irc.irchighway.net
Re: $mircdir [Re: Riamus2] #228349 19/12/10 03:18 PM
Joined: Jan 2008
Posts: 57
D
DeSync Offline OP
Babel fish
OP Offline
Babel fish
D
Joined: Jan 2008
Posts: 57
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

Re: $mircdir [Re: DeSync] #228363 20/12/10 12:23 AM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
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


Invision Support
#Invision on irc.irchighway.net
Re: $mircdir [Re: Riamus2] #228370 20/12/10 12:25 PM
Joined: Jan 2008
Posts: 57
D
DeSync Offline OP
Babel fish
OP Offline
Babel fish
D
Joined: Jan 2008
Posts: 57
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.

Re: $mircdir [Re: DeSync] #228386 20/12/10 08:01 PM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
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!

Re: $mircdir [Re: westor] #228388 20/12/10 08:25 PM
Joined: Jan 2008
Posts: 57
D
DeSync Offline OP
Babel fish
OP Offline
Babel fish
D
Joined: Jan 2008
Posts: 57
At the end, that was solved my problem. But when instaling as portable, it do same thing.

Re: $mircdir [Re: DeSync] #228390 20/12/10 09:15 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
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.


Invision Support
#Invision on irc.irchighway.net
Re: $mircdir [Re: DeSync] #228698 07/01/11 06:56 PM
Joined: Aug 2004
Posts: 4
B
borgx Offline
Self-satisified door
Offline
Self-satisified door
B
Joined: Aug 2004
Posts: 4
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
}


-borgx
Re: $mircdir [Re: DeSync] #228701 07/01/11 10:15 PM
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
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.