FTP scripting on Windows 2000

N

nsajus

Hi,

Is there a way to concatenate date to a string in the .scp script
file?. I
want to get the following string in the .scp file


"\\server2\TestDir\Test_CH\Archive\CH"&Date&".txt"


It should result in a string like


"\\server2\TestDir\Test_CH\Archive\CH12102005.txt"


with the date in mmddyyyy format. Is it possible to set it like this in

a .scp file?

I would like to do this because I want to email the latest file from an
Archive directory to a remote server. And the files in the Archive
folder have the date appended to it.

So basically I would like put statement generated dynamically in the
..scp file everyday with the date like below:


PUT "\\server2\TestDir\Test_CH\Archive\CH12102005.txt" "CH.DAT"

where "\\server2\TestDir\Test_CH\Archive\CH12102005.txt" is on local
machine

and

"CH.DAT" will be name of the file on the remote machine


Any help will be very much appreciated!


Ann
 
N

nsajus

I would like to do this because I want to email the latest file from an
Archive directory to a remote server. And the ..

Sorry..what i meant to say was ftp the latest file..

Thanks,
Ann
 
P

Pegasus \(MVP\)

Hi,

Is there a way to concatenate date to a string in the .scp script
file?. I
want to get the following string in the .scp file


"\\server2\TestDir\Test_CH\Archive\CH"&Date&".txt"


It should result in a string like


"\\server2\TestDir\Test_CH\Archive\CH12102005.txt"


with the date in mmddyyyy format. Is it possible to set it like this in

a .scp file?

I would like to do this because I want to email the latest file from an
Archive directory to a remote server. And the files in the Archive
folder have the date appended to it.

So basically I would like put statement generated dynamically in the
.scp file everyday with the date like below:


PUT "\\server2\TestDir\Test_CH\Archive\CH12102005.txt" "CH.DAT"

where "\\server2\TestDir\Test_CH\Archive\CH12102005.txt" is on local
machine

and

"CH.DAT" will be name of the file on the remote machine


Any help will be very much appreciated!


Ann

Here is how to get the string
"\\server2\TestDir\Test_CH\Archive\CHmmddyyyy.txt"
into a text file:

echo>test.scp
\\server2\TestDir\Test_CH\Archive\CH%date:~4,2%%date:~7,2%%date:~10,4%

(this is one single long line!)

Depending on your date format zone, you may have
to adjust the numbers 4,2, 7,2, 10,4 to suit your
requirements.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top