in reply to is this file open?

I'd be inclined to skip the file write and Notepad step altogether and simply use Win32::Clipboard to set the text in the clipboard directly.

True laziness is hard work