I want to reliably download the pic from my website, save it to a folder, and rename it with a time and date stamp.
I have found some code that sorts of does this, but I don't fully understand how it works.
The problem with it is that it does download the file, but only works when the time stamp for hour is in double figures...ie after 10am
Also it creates a new folder for every day, but after 24 hours it deletes the contents of the folder for some reason....it's wierd, and I can't understand why it's doing that. The folder remains, but as it downloads a picture with the same time stamp, it slowly deletes those files from yesterdays folder.
Here's the code I am using....as I said, am no expert, and just acquired it from the net, and was wondering if someone could look at it, and work out what is going on.....or give me a better alternative to do the job
Code: Select all
echo on
c:
cd\WebCams\Capture\Webcam2\
md %date:~-4,4%-%date:~3,2%-%date:~-10,2%
cd\
del c:\WebCams\Capture\Webcam2\%date:~-4,4%-%date:~3,2%-%date:~-10,2%\cam_1.jpg
cd\WebCams\Capture\Webcam2\%date:~-4,4%-%date:~3,2%-%date:~-10,2%
wget http://www.ironeagleuk.co.uk/cumulus/webcam/cam_1.jpg
cd\
cd\WebCams\Capture\Webcam2\%date:~-4,4%-%date:~3,2%-%date:~-10,2%\
ping -n 15 www.ironeagleuk.co.uk
ren cam_1.jpg cam_2_%time:~0,2%%time:~3,2%-%date:~-10,2%%date:~3,2%%date:~-4,4%.jpg
ping -n 15 www.ironeagleuk.co.uk
c:\camrename.bat