when that happened to me i just noticed it was a script trying to write to $scriptdir without quotes or $shortfn, so it only got to the "c:\program" part of "c:\program files\...."