How do I get the last time stamp of a .txt
file from WinSCP when using .txt
and .bat
scripting?
Asked
Active
Viewed 1,299 times
-1

Martin Prikryl
- 188,800
- 56
- 490
- 992

Rhodo
- 1,234
- 4
- 19
- 35
1 Answers
1
Well, you should better state, what do you want to do with the timestamp. You might get better answer then.
Anyway:
WinSCP has the
stat
command:stat /home/martin/index.html
Outputs something like:
-rwxr--r-- 0 20480 Jan 5 14:09:33 2009 index.html
You can redirect the output of the WinSCP script to a file and parse.
Or even better use XML logging and parse the XML log.
Easier solution may be to make use of WinSCP .NET assembly method
Session.GetFileInfo
.An additional example (to those linked in the method documentation) is here:
https://winscp.net/eng/docs/scriptcommand_stat#net

Martin Prikryl
- 188,800
- 56
- 490
- 992