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]
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]