Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.msdos.batch.nt    |    Fun with Windows NT batch files    |    68,980 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 67,507 of 68,980    |
|    Robert Roland to asyadav5@gmail.com    |
|    Re: Batch Script Yesterday date file for    |
|    18 Mar 20 13:03:30    |
   
   From: fake@ddress.no   
      
   On Tue, 17 Mar 2020 21:42:01 -0700 (PDT), asyadav5@gmail.com wrote:   
      
   >i am new for batch script language.   
      
   I recommend spending your time with Powershell in stead. The learning   
   curve is steeper, but the return is well worth it.   
      
   >can anyone help me to get yesterday date,   
      
   Powershell has the capability to run commands directly from its own   
   command line, so we can "disguise" the Powershell commands as batch.   
      
   This is one single line:   
      
   for /F "usebackq" %%n in (`powershell -ExecutionPolicy ByPass -Command   
   "((Get-Date).AddDays(-1)).ToString('yyyyMMdd')"`) do set Yestdate=%%n   
   --   
   RoRo   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca