Two things should be noted regarding $isfile() vs $exists():
$isfile() is useful if you want to make sure that when you /run %x, you won't get an Explorer window opening the folder %x that might happen to exist in the current folder.
However, if you assume that you can safely /write %x if $isfile() returns $false, you can run into problems, because if the folder %x exists in the current folder, you cannot create a file named %x there. In such cases, you'd need to use $isdir() or $exists().
What I'd do in this case is first check $exists(). If it returns $false, /write the file and /run it right away. Otherwise, also check $isfile(); if it returns $true, /run it right away, otherwise /write using another filename and /run it.
Of course, things can still go wrong if the file %x exists but contains other stuff than those .ini sections, but checking that is a bit too much; one might as well create a unique file anyway.
Last edited by qwerty; 13/08/07 03:59 PM.