I'm trying to create a small batch file that will copy some files from a Windows 2008 server to a Windows 7 PC. The (very simple) batch file is:
When I run this directly from the command prompt on the Windows 7 PC, all the files get copied and the log.txt is updated with the time and date of the run.
However, when trying to schedule this via Scheduled Tasks on the same PC, the batch file runs but the files are not copied over, although the time and date are being updated in log.txt.
I've got the scheduled task set to run as an admin and permissions seem fine, but it just won't work through scheduled tasks.
I've googled and from what I can tell the above code should work but it clearly isn't. Can anyone advise on what I might be missing here?
Thanks
Code:
copy /Y p:\db\file1.DBF c:\db
copy /Y p:\db\file2.DBF c:\db
copy /Y p:\db\file3.DBF c:\db
echo Date.%Date% >>c:\db\log.txt
echo Time.%Time% >>c:\db\log.txt
When I run this directly from the command prompt on the Windows 7 PC, all the files get copied and the log.txt is updated with the time and date of the run.
However, when trying to schedule this via Scheduled Tasks on the same PC, the batch file runs but the files are not copied over, although the time and date are being updated in log.txt.
I've got the scheduled task set to run as an admin and permissions seem fine, but it just won't work through scheduled tasks.
I've googled and from what I can tell the above code should work but it clearly isn't. Can anyone advise on what I might be missing here?
Thanks