title: How to Convert a string to date in batch scripting?
body: <p>I want to create task Scheduler  using batch script to run a .exe file to remove all setup after 40 days from installation. So I am calculating and getting  the date after current date in string format.</p>
  
  <pre><code>::After Executing some command line now my values are
  ::newDD=22
  ::newMM=7
  ::newYYYY=2017
  echo "%newMM%/%newDD%/%newYYYY%"
  set nxtDate=%newMM%/%newDD%/%newYYYY%
  echo %nxtDate%
  
  schtasks /create /tn "laptopAuditseldsestrt" /tr 
  "D:\LatestTest\LaptopAudit\exe_files\uninstall.exe"  /sc once /st 23:59:00 /sd %nxtDate% /f  
  </code></pre>
  
  <p>Now my problem is am getting 
  ERROR: Invalid Start Date (Date should be in "mm/dd/yyyy" format). while creating task scheduler. Please help how to solve this.</p>