Hello:
On Windows Server 2008 R2, we use Task Scheduler to copy an Excel spreadsheet from one folder to another on that server's C drive.
The scripting at the end of this posting is an excerpt from the *.bat file that is used by Task Scheduler to conduct this copying.
Our end user places a spreadsheet in the first directory specified in the scripting. Then, Task Scheduler uses the scripting to copy the spreadsheet to the new directory and renames the spreadsheet to "SpecialAPLoadInput.xlsx".
Up until a few weeks ago, there were no issues. This copying, in fact, has been working for years.
Now, the copy of the spreadsheet will not open in the directory that it is copied to.
In fact, upon trying to open the copy, we get the message "Excel found unreadable content...". In fact, if I copy that spreadsheet from the "new" directory to my laptop's Desktop and try to open it, I get a similar error.
So, instead of relying on Task Scheduler to copy the spreadsheet, I have to ask the user to e-mail the spreadsheet to me. Then, I manually copy and paste the spreadsheet into the directory and rename it myself. At that point, the spreadsheet can be successfully opened and used by our application that imports data from the spreadsheet.
One thing that I have noticed that happens consistently is that, no matter how big the original Excel spreadsheet is, the copying creates a copied file that is only 2KB in size. It's as if Task Scheduler is starting the copying of the file, doesn't quite finish the copy, and we're left with a useless and ultimately corrupt copy of a spreadsheet.
Why would an Excel spreadsheet copied into a folder by Task Scheduler become corrupt, especially after years of successfully using this process?
Thanks!
John
Copy "C:\Scripts\OnDeck\SpecialAPLoad\*" "C:\Scripts\Input\Special APload\SpecialAPLoadInput.xlsx" /y
*This post is locked for comments