command display yesterday date
Answers
Answered by
0
Answer:
what is the question
Explanation:
mark me as brainliest
Answered by
0
How to get and display yesterday date batch-file?
Answer:
The date command is what I'm utilizing in a batch script.
Explanation:
- The date variable's locale sensitivity is its principal point of vulnerability.
- If PowerShell is available to you (it's much more popular these days, even in large businesses), you may use it to prepare the data and include it in a batch FOR statement.
- The PowerShell line that follows will calculate the date and format it for you:
- PowerShell Get-Date is used when $date is $date. $date; Add Days(-1). ToString('yyyy-MM-dd')
- Then, you can run this through FOR to put it into a batch file variable (remembering to use the hat symbol to escape a large number of characters and the backtick to get rid of embedded quotes):
- PowerShell $date = Get-Date; $date = $date; for /f "usebackq" percent percent i.
- Add Days; $date; -1.
- I echo YESTERDAY=%
- I'm confident that someone with advanced PowerShell and Batch programming skills could make it more understandable and maintainable by reducing the PowerShell command and/or the number of escaped characters.
#SPJ2
Similar questions