The write error seems to indicate the directory you want to create the file in doesn't exist yet. mIRC cannot create directories on the fly whil attempting to write files into them.

Second, in your skincopyes alias you have $did(4). This identifier has no value whatsoever, since you are not in an on DIALOG event. You need to pass the value of $did(4) in the on DIALOG event to the alias so you can reference it from there.