fix file handling in shadow copies and runonce path