{"id":53,"date":"2008-05-18T08:52:05","date_gmt":"2008-05-18T13:52:05","guid":{"rendered":"http:\/\/www.cfchimp.com\/wordpress\/?p=53"},"modified":"2024-12-05T12:29:29","modified_gmt":"2024-12-05T17:29:29","slug":"dos-bat-files-what-i-learned-from-writing-a-subversion-backup-script","status":"publish","type":"post","link":"https:\/\/csimmons.dev\/blog\/2008\/05\/dos-bat-files-what-i-learned-from-writing-a-subversion-backup-script\/","title":{"rendered":"DOS .bat files (What I learned from writing a subversion backup script)"},"content":{"rendered":"<p>Comments<br \/>\n<code>REM Comment Style 1<br \/>\n:: Comment Style 2<\/code><br \/>\nSet a variable<br \/>\n<code>SET myCat=Dante<\/code><br \/>\nOutput a variable<br \/>\n<code>ECHO %myCat%<\/code><br \/>\nIf then Else statement<br \/>\n<code>if %yCat%== \"Dante\" (ECHO MY CAT) ELSE (ECHO NOT MY CAT)<\/code><br \/>\nOutput a command&#8217;s result to a file<br \/>\n<code>dir &gt;&gt; log.txt<\/code><br \/>\nSplit a command across 2 lines (use ^ at the end of the line)<br \/>\n<code>ECHO This is line one and ^<br \/>\nthis is line 2.<\/code><br \/>\nTwo commands on 1 line (separate with &amp;)<br \/>\n<code>echo command 1 &amp; echo command2<\/code><br \/>\nList only directory names and no info<br \/>\n<code>dir \/b \/ad<\/code><br \/>\nFor-in-do (For every item do something)<br \/>\n<code>FOR \/F %%G IN ('dir \/b \/ad %repodir%') DO ECHO %%G<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Comments REM Comment Style 1 :: Comment Style 2 Set a variable SET myCat=Dante Output a variable ECHO %myCat% If then Else statement if %yCat%== &#8220;Dante&#8221; (ECHO MY CAT) ELSE (ECHO NOT MY CAT) Output a command&#8217;s result to a file dir &gt;&gt; log.txt Split a command across 2 lines (use ^ at the end &#8230; <a title=\"DOS .bat files (What I learned from writing a subversion backup script)\" class=\"read-more\" href=\"https:\/\/csimmons.dev\/blog\/2008\/05\/dos-bat-files-what-i-learned-from-writing-a-subversion-backup-script\/\" aria-label=\"Read more about DOS .bat files (What I learned from writing a subversion backup script)\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"_cloudinary_featured_overwrite":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[68],"tags":[12,38],"class_list":["post-53","post","type-post","status-publish","format-standard","hentry","category-developer","tag-developer","tag-dos"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pbVg43-R","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/posts\/53","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/comments?post=53"}],"version-history":[{"count":0,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/posts\/53\/revisions"}],"wp:attachment":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/media?parent=53"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/categories?post=53"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/tags?post=53"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}