lssp [ -b ] [ -l | -a | -p | -lp ] -s site -f folder
The columns are separated by a tabluator character.
This listing includes the modification date of the file and the filename.
This listing includes the file size in bytes, the modification date of the and the filename.
Therefore the firsts column is the modification time and the 2nd column is the file name with full absolute path (URL).
The site can also be specified in the %LSSP_SITE% environment variable. However, the command line option has preference over the setting in the environment variable.
If the folder is terminated by a / (=slash) all files in the folder are listed.
If the folder does not terminate by a / (=slash) the part from the last slash to the end of the specification is a regular expression that allows selecting specific file(s).
The folder can also be specified in the %LSSP_FOLDER% environment variable. However, the command line option has preference over the setting in the environment variable.
See also EXAMPLES section below.
List all files in the folder Shared Documents/Report/Capacity Data/ on the http://share.acme.ch/workgroups/wg007 Sharepoint™ site:
lssp -s http://share.acme.ch/workgroups/wg007 ^ -f "Shared Documents/Report/Capacity Data/"
Select only the files that have 07.2019 and 08.2019 in the file name:
lssp -s http://share.acme.ch/workgroups/wg007 ^ -f "Shared Documents/Report/Capacity Data/.*0[7-8].2019"
List files with the file modification time as first column and sort it ascending:
lssp -l ^ -s http://share.acme.ch/workgroups/wg007 ^ -f "Shared Documents/Report/Capacity Data/" ^ | sort
List full path (the full URL) of the files with the file modification time as first column, sort it ascending and output only the last (=the newest) file:
lssp -lp ^ -s http://share.acme.ch/workgroups/wg007 ^ -f "Shared Documents/Report/Capacity Data/" ^ | sort | tail -1
List files with the file modification time as first column, sort it ascending, output only the last file and use the 2nd column (the full URL of the file) to download the source file and save it locally as newest.xlsx file:
lssp -lp ^ -s http://share.acme.ch/workgroups/wg007 ^ -f "Shared Documents/Report/Capacity Data/" ^ | sort | tail -1 | cut -f2 ^ | DownloadFile -s - -d newest.xlsx
As example 5) but preserve source file name when downloading.
The downloaded source file will be saved in the directory downloads (which must exist):
mkdir downloads lssp -lp ^ -s http://share.acme.ch/workgroups/wg007 ^ -f "Shared Documents/Report/Capacity Data/" ^ | sort | tail -1 | cut -f2 ^ | DownloadFile -s - -d downloads
As example 5) but save source file with a timestamp prefix.
The timedat command is used to set a list of time and date related environment variables that can be used in scripts (batch files):
@echo off setlocal enabledelayedexpansion for /f "tokens=*" %%r in ('!WA2L_INSTALLDIR!\lib\timedat.exe') do %%r mkdir downloads 2>nul lssp -lp ^ -s http://share.acme.ch/workgroups/wg007 ^ -f "Shared Documents/Report/Capacity Data/" ^ | sort | tail -1 | cut -f2 ^ | DownloadFile -s - -d downloads\!Now!-Capacity-Report.xlsx endlocal
This is free software; see WA2LWinTools/man/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.