how i tide date/time windows management line suitable format use file/folder name?


update: it's 2016 i'd powershell unless there's unequivocally compelled backwards-compatible reason it, quite since impromptu settings emanate controlling date. @npocmaka's






what's windows management line statement(s) i tide datetime format i put filename?



i wish have .bat record zips adult office an repository tide date biased name, example, code_2008-10-14_2257.zip. there any easy proceed i this, individualist impromptu settings machine?



i don't unequivocally mind date format, ideally it'd yyyy-mm-dd, nonetheless anything rudimentary fine.



so distant i've got this, accessory gives me tue_10_14_2008_230050_91:



rem datetime format filename.
set _my_datetime=%date%_%time%
set _my_datetime=%_my_datetime: =_%
set _my_datetime=%_my_datetime::=%
set _my_datetime=%_my_datetime:/=_%
set _my_datetime=%_my_datetime:.=_%

rem timestamp new zip record name.
"d:\program files\7-zip\7z.exe" -r code_%_my_datetime%.zip code


i live this, nonetheless seems bit clunky. ideally it'd briefer have format mentioned earlier.



i'm controlling windows server 2003 windows xp professional. i don't wish exercise additional utilities grasp (although i comprehend there good date formatting).



Comments

Popular posts from this blog

list macos calm editors formula editors

how i practical urls indicate .aspx pages asp.net deployed an iis? (preferably but iis)

jaxb - xjc - reworking generated typesafe enum category members