Date for batch file I need to know how to create a batch file that will post to an ftp by looking for a file with a specified date. It's a two step process. First, a batch file is run to encrypt, and the output file is KML_06082004.pgp. Then another batch file needs to be run to post a file to a client's ftp site. Currently, what I'm doing is going into the second batch file that posts the file and changing the date every week to the current date in the mmddyyyy format. I've been looking online for a way to run it so I don't have to change the date every week, but all I keep finding is how to encrypt a file with the date as part of the name, and I already know how to do this. This is the code that encrypts the file
Note...Actual names have been changed to protect the innocent.
--------------------------------------------
echo off
set year=%date:~10,4%
set month=%date:~4,2%
set day=%date:~7,2%
set newdate=%month%%day%%year%
echo %newdate%
Pause
C:
cd gnupg
gpg -o C:\KML_%newdate%.pgp -r xxxxxxxx -e C:\KML.txt
------------------------------------------------------------
This is the file that sends it out...(minus the username and password of course)
------------------------------------------------------
open ftp.myftp.com
lcd C:\
binary
put KML_06082004.pgp
quit
-----------------------------------------------
Anyone got any solutions or a link that can help me out? It's not like this is killling me doing this, it's just annoying having to change this every week. |