Travis
Historical / Guest
When mIRC changed to version 6.31 or 6.32 Khaled decided to support Windows Vista by making your default mirc directory in your Users\Application Data\Roaming folder ... Why? I haven't asked but I don't see any good reason for it.
Anyways, this can be a major pain in the butt when allowing others to use your scripts. I have seen other ideas in the past to deal with this but always ignored them until I had to deal with it. Now that I have to deal with it this is what I made.
alias dir { return $qt($+($nofile($mircexe),$1)) }
Ex: /run $dir(songs\file.mp3)
Using quotes ($qt) is up to you. I do that because some people like to runt heir mirc fromt he desktop.
I know other people had other ways of doing this ... Warrior ... Please add your solutions to this thread!
Edited Jul 26, 2008 5:23 PM by Travis
You can use this code instead of $findfile to help you find files more easily, and faster...
alias ff {
if (!%ff. [ $+ [ $1- ] ]) || (!$exists(%ff. [ $+ [ $1- ] ])) set %ff. [ $+ [ $1- ] ] $qt($longfn($findfile($nofile($mircexe),$1-,1)))
return %ff. [ $+ [ $1- ] ]
}
To use type in something like...
echo -a $ff(mdx.dll)
[/code]
It will find mdx.dll, and echo its location.
Great work, Travis. 
Edited Jul 29, 2008 6:58 AM by Warrior124
Travis
Historical / Guest
Thanks Warrior & likewise.
Well I was getting pretty pissed about how mIRC now handles it's settings files and found some answers that should help.
All of this code presented is unneeded.
$mircdir refers to where the mirc.ini file is. New mirc's default location is in your Application Data folder group. So if the mirc.ini for the mirc.exe you are using is in that folder group you will get that for your path.
But! If mirc.ini is in your script folder then mIRC will act like it always has.
Bottom line. As long as mirc.ini is in your script folder you dont have to worry about this "accurate file location" deal.
If mirc.ini isn't in your script folder and you would like it to be, follow the path to find the file and copy and paste it to the desired directory.
To find the file location use this. //echo -a $mircdir. This will point you there.
Here is another code you can use...
on *:INPUT:*: {
$eval($replace($1-,$chr(36) $+ mircdir,$nofile($mircexe)),2)
haltdef
}
With this code you can still use $findfile($mircdir,mdx.dll,1) to reveal where mdx.dll in the correct mirc folder.
Edited Jul 30, 2008 12:24 AM by Warrior124
Travis
Historical / Guest
20.For Vista compatibility, new installations of mIRC now save all
settings in the User's "Application Data\mIRC" folder by default.
However, if the installer or mIRC find mirc.ini in the same folder
as mirc.exe they will use the mirc.exe folder for all settings.
Users installing over an old version of mIRC should therefore see
no change in behaviour.
The installer is now also aware of administrator and standard user
accounts and installs mIRC accordingly.
takaharu_
Proof-reading pedantic pain in the proverbial Member #17,633
The alias dir { return $qt($+($nofile($mircexe),$1)) } code doesn't return the AppData folder; it returns c:\program files for those that didn't know.
$mircdir is where the scripts are stored 
Edited Nov 2, 2008 1:03 PM by takaharu_
I don't get paid to know the answer, therefore I'm far more likely to give you a straight and honest answer.
Travis
Historical / Guest
It should return the path for the active mirc.exe.
Travis
Historical / Guest
Ok so? Nothing is wrong. Use $mircexe, use $scriptdir, make sure mirc.ini is in your mirc folder and use neither!
Using $scriptdir doesn't make it irrelevant. It's just another way of handling the issue of file paths in versions 6.2+. I like to use $mircexe if I have to because that is ONE SOLID LOCATION. $scriptdir refers to the path of the currently executing script. I don't know about you but I have scripts in the main folder and some in subdirectories. I wanted a path that pointed to the ROOT folder always. This is why I chose $mircexe.
In all actuality I personally just make sure mirc.ini is in my main folder and I have no issues. The code was to help others out.