windows_batch_scripting
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| windows_batch_scripting [2015/07/23 15:19] – add "Check if the current batch script has admin rights" zertrin | windows_batch_scripting [2015/08/04 20:18] (current) – add "Delete folders older than 10 days" zertrin | ||
|---|---|---|---|
| Line 117: | Line 117: | ||
| pause >nul | pause >nul | ||
| </ | </ | ||
| + | |||
| + | |||
| + | ==== Get current time in a locale independent way ==== | ||
| + | |||
| + | from http:// | ||
| + | |||
| + | < | ||
| + | FOR /f %%a in ('WMIC OS GET LocalDateTime ^| find " | ||
| + | set CUR_DATE=%DTS: | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== Delete folders older than 10 days ==== | ||
| + | |||
| + | from http:// | ||
| + | |||
| + | < | ||
| + | FORFILES /S /D -10 /C "cmd /c IF @isdir == TRUE rd /S /Q @path" | ||
| + | </ | ||
| + | |||
windows_batch_scripting.1437635975.txt.gz · Last modified: by zertrin
