{"id":1558,"date":"2018-07-14T15:29:52","date_gmt":"2018-07-14T15:29:52","guid":{"rendered":"https:\/\/scunster.co.uk\/?p=1558"},"modified":"2018-07-14T15:53:14","modified_gmt":"2018-07-14T15:53:14","slug":"adding-data-time-to-filename-from-within-a-bat-file","status":"publish","type":"post","link":"https:\/\/scunster.co.uk\/?p=1558","title":{"rendered":"Adding date \/ time to filename from within a bat file"},"content":{"rendered":"<p>I was trying to create a new filename with the cuireent date and time from a bat file.<\/p>\n<p>The standard command of %date% and %time% weren&#8217;t working as a filename as they crated \/ and : symbols<\/p>\n<p>Non working example<\/p>\n<pre>ren myfile.txt mynewfile-%date%-%time.txt<\/pre>\n<p>This won&#8217;t work because it would create the file<\/p>\n<pre>mynewfile-11\/01\/2018-11:11:29<\/pre>\n<p>Working example using<\/p>\n<pre>ren myfile.txt %date:\/=% and %time::=%<\/pre>\n<p>Creates<\/p>\n<pre>mynewfile-14072018-144329.21<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I was trying to create a new filename with the cuireent date and time from a bat file. The standard command of %date% and %time% weren&#8217;t working as a filename as they crated \/ and : symbols Non working example ren myfile.txt mynewfile-%date%-%time.txt This won&#8217;t work because it would create the file mynewfile-11\/01\/2018-11:11:29 Working example [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[169,17,168],"tags":[419,197,420,418],"class_list":["post-1558","post","type-post","status-publish","format-standard","hentry","category-win-7-10-tips-tricks","category-windows","category-xp-tips-tricks","tag-time","tag-bat","tag-date","tag-te"],"_links":{"self":[{"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1558","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1558"}],"version-history":[{"count":3,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1558\/revisions"}],"predecessor-version":[{"id":1561,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1558\/revisions\/1561"}],"wp:attachment":[{"href":"https:\/\/scunster.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1558"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1558"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}