VBS and BAT parameters
Posted: 31 Jan 2020 14:18
I have the following .bat file being used to run a series of jobs to:
1) run a vbs script to calculate the previous weeks dates for Monday and Saturday
2) run a series of commands with the dates calculated to extract data from a commercial finance application
3) run a vbs script to load and run an Excel macro
The first part of the batch file is as follows:
GetLastWeek.vbs is as follows:
This will work fine for returning 1 date (GetLastMonday), but I also need the second date (GetLastSaturday).
What do I need to do to pass both values back to the bat file?
Thank you.
1) run a vbs script to calculate the previous weeks dates for Monday and Saturday
2) run a series of commands with the dates calculated to extract data from a commercial finance application
3) run a vbs script to load and run an Excel macro
The first part of the batch file is as follows:
Code: Select all
echo off
rem Get last weeks Monday-Saturday dates
for /F %%n in ('cscript.exe //nologo GetLastWeek.VBS') do set LastWeek=%%n
Code: Select all
GetThisMonday = DateSerial(Year(Date), Month(Date), Day(Date) - DatePart("w", Date) + 1)
GetThisMonday=DateAdd("d",+1,GetThisMonday)
GetLastMonday=DateAdd("ww",-1,GetThisMonday)
GetLastSaturday=DateAdd("d",+6,GetLastMonday)
wscript.echo GetLastMonday
What do I need to do to pass both values back to the bat file?
Thank you.