We don't provide script debugging services but if you can't open a file, it is for one of only a few reasons. It could be that the file doesn't exist, the file is corrupt, the path is incorrect, or the script does not have the correct permissions to access the file. It shouldn't be to hard to figure out which one it is based on the context the service is running under. You are accessing the "D" drive which on servers is generally the "Data" partition on a local physical drive. If it happens to be a mapped drive instead, it could be the cause of your problem because mapped drives are by default mapped by security id.