{"id":599,"date":"2020-08-12T23:42:02","date_gmt":"2020-08-13T06:42:02","guid":{"rendered":"http:\/\/gantovnik.com\/bio-tips\/?p=599"},"modified":"2020-08-13T00:11:48","modified_gmt":"2020-08-13T07:11:48","slug":"88-windows-batch-bat-script-that-counts-from-0-to-10-by-increments-of-2","status":"publish","type":"post","link":"https:\/\/gantovnik.com\/bio-tips\/2020\/08\/88-windows-batch-bat-script-that-counts-from-0-to-10-by-increments-of-2\/","title":{"rendered":"#88 Windows batch (bat) script that counts from 0 to 10 by 2"},"content":{"rendered":"<p>#88 Windows batch (bat) script that counts from 0 to 10 by 2:<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfor \/l %%B in (0,2,10) do echo %%B\npause\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>#88 Windows batch (bat) script that counts from 0 to 10 by 2: for \/l %%B in (0,2,10) do echo %%B pause<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","_lmt_disableupdate":"yes","_lmt_disable":"","jetpack_post_was_ever_published":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":[17],"tags":[],"class_list":["post-599","post","type-post","status-publish","format-standard","hentry","category-batch"],"modified_by":null,"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8bH0k-9F","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":601,"url":"https:\/\/gantovnik.com\/bio-tips\/2020\/08\/89-windows-batch-bat-script-that-counts-from-10-to-0-by-2\/","url_meta":{"origin":599,"position":0},"title":"#89 Windows batch (bat) script that counts from 10 to 0 by 2","author":"gantovnik","date":"2020-08-13","format":false,"excerpt":"#89 Windows batch (bat) script that counts from 0 to 10 by 2: [code language=\"python\"] for \/l %%B in (10,-2,0) do echo %%B pause [\/code]","rel":"","context":"In &quot;batch&quot;","block_context":{"text":"batch","link":"https:\/\/gantovnik.com\/bio-tips\/category\/batch\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":688,"url":"https:\/\/gantovnik.com\/bio-tips\/2020\/09\/121-windows-batch-script-to-run-every-nastran-input-file-in-folder\/","url_meta":{"origin":599,"position":1},"title":"#121: Windows batch script to run every Nastran input file in folder","author":"gantovnik","date":"2020-09-28","format":false,"excerpt":"This is an example of a Windows bat file to run Nastran for every *.dat file in the current folder. It also calculates the total Nastran execution time. Of course, you should change the path to nastran.exe. The nice thing here is that script uses variable set MyPath=%cd%, so you\u2026","rel":"","context":"In &quot;batch&quot;","block_context":{"text":"batch","link":"https:\/\/gantovnik.com\/bio-tips\/category\/batch\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":593,"url":"https:\/\/gantovnik.com\/bio-tips\/2020\/07\/87-batch-script-to-delete-empty-folders\/","url_meta":{"origin":599,"position":2},"title":"#87 One-line batch script to delete empty directories","author":"gantovnik","date":"2020-07-31","format":false,"excerpt":"#87 One-line batch script to delete empty directories: Variant 1 [code language=\"python\"] for \/f \"delims=\" %%i in ('dir \/s \/b \/ad ^| sort \/r') do rd \"%%i\">NUL [\/code] Variant 2 [code language=\"python\"] for \/f \"usebackq\" %%d in (`\"dir \/ad\/b\/s | sort \/R\"`) do rd \"%%d\" [\/code]","rel":"","context":"In &quot;batch&quot;","block_context":{"text":"batch","link":"https:\/\/gantovnik.com\/bio-tips\/category\/batch\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":851,"url":"https:\/\/gantovnik.com\/bio-tips\/2021\/01\/151-script-to-create-multi-volume-rar-archive-with-specific-size-of-each-volume\/","url_meta":{"origin":599,"position":3},"title":"#151 Script to create multi-volume rar archive with specific size of each volume","author":"gantovnik","date":"2021-01-27","format":false,"excerpt":"#151 Script to create multi-volume rar archive with a specific size of each volume. I request 3GB for each volume. Create a bat file with the following code: [code language=\"python\"] SET WINRAR=\"C:\\Program Files\\WinRAR\" for \/D %%f in (\"D:\\create_rars\\*\") do ( %WINRAR%\\RAR.exe a -ep1 -r -v3G -idcdp -t -df \"D:\\create_rars\\%%~nxf.rar\" \"%%f\"\u2026","rel":"","context":"In &quot;batch&quot;","block_context":{"text":"batch","link":"https:\/\/gantovnik.com\/bio-tips\/category\/batch\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":432,"url":"https:\/\/gantovnik.com\/bio-tips\/2019\/07\/windows-batch-script-to-print-nth-lines-after-line-containing-matched-string\/","url_meta":{"origin":599,"position":4},"title":"#63 Batch script to print n-th lines after line containing matched string","author":"gantovnik","date":"2019-07-26","format":false,"excerpt":"[code language=\"python\"] @echo off setlocal enableDelayedExpansion set \"word=VON MISES\" set \"keep=3\" set \"file=model.f06\" find \" X \" model.f06 > extract_weight.txt del extract_stress.txt set n=%keep% for \/f \"usebackq delims=\" %%A in (\"%file%\") do ( set \"ln=%%A\" if \"!ln:%word%=!\" neq \"!ln!\" ( echo( set n=0 ) if !n! lss !keep! ( echo\u2026","rel":"","context":"In &quot;batch&quot;","block_context":{"text":"batch","link":"https:\/\/gantovnik.com\/bio-tips\/category\/batch\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":907,"url":"https:\/\/gantovnik.com\/bio-tips\/2021\/05\/164-batch-script-to-create-md5-hash-for-every-file-in-the-folder-then-write-them-to-the-text-file\/","url_meta":{"origin":599,"position":5},"title":"#164 Batch script to create md5 hash for every file in the folder, then write them to the text file","author":"gantovnik","date":"2021-05-05","format":false,"excerpt":"#164 Batch script to create md5 hash for every file in the folder, then write them in text file [code language=\"python\"] @echo off FOR \/F \"delims=\" %%F IN ('dir \/B \/A \/S *') DO ( for %%D in (\"%%~dpF\\.\") do ( set filename=%%~nxD.md5 ) ) TYPE NUL > %filename% For\u2026","rel":"","context":"In &quot;batch&quot;","block_context":{"text":"batch","link":"https:\/\/gantovnik.com\/bio-tips\/category\/batch\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/599","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/comments?post=599"}],"version-history":[{"count":0,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/599\/revisions"}],"wp:attachment":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/media?parent=599"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/categories?post=599"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/tags?post=599"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}