Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

Apurv

Batch File not reading Varibles

Hello,

I have created a batch script{below} that refers to Credentials file:
set Pathname="C:\Program Files\WinSCP"
pushd %Pathname%
winscp.com /script="D:\Test\Credentials.txt"


The files I am trying to extract come with date and a random stamp. All the files, including previous days files, are placed in same directory.
eg:
User_20131227_010203.txt
User_20131226_098778.txt
User_20131225_093110.txt

I have to extract latest files.I am trying to use 'User__%date:~-4,4%%date:~-7,2%%date:~-10,2%-*'
But SFTP commands don't seem to understand these variables.

Any way to extract latest files or read variables?
Any help is appreciated.

Thanks!
[/img]