Hello WD and friends,
I have a batch script that I am trying to run on a Windows 10 Enterprise computer that will do the following…
1.) Change directory to the Admin Desktop
2.) Create a new folder on the desktop with the current date
3.) Copy a file on the Windows machine to the new directory
4.) Move the directory to the Public NAS storage location
Step 4 is where the script hangs up, it says “Access is Denied”
I thought this was a public folder, and I wouldn’t need to set any windows NTFS permissions? I also need to run this script from the task scheduler daily, so anyone who has some advice as to why it doesn’t work would be helpful.
As a note, I set the hosts file on the windows machine to resolve the hostname to the current IP address (statically set through DHCP reservation). Therefore I can ping it from the command line using the hostname. I’ve attached the script below, and also noticed how I’ve commented out the hostname at the bottom of the script, trying both ways of destination as either the hostname, or through using sharename.
cd C:\Users\Administrator\Desktop
setlocal enableextensions
set TIMESTAMP=%DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%
mkdir %TIMESTAMP%
copy “C:\TwinCAT\3.1\Boot\Plc\Port_851.bootdata” “C:\Users\Administrator\Desktop%TIMESTAMP%”
move “C:\Users\Administrator\Desktop%TIMESTAMP%” “Z:\BootData Backups\Roboframe”
pause