{"id":1699,"date":"2015-01-03T22:30:04","date_gmt":"2015-01-03T22:30:04","guid":{"rendered":"http:\/\/www.gssezisoft.com\/main\/?p=1699"},"modified":"2015-06-14T12:20:17","modified_gmt":"2015-06-14T12:20:17","slug":"another-cmdtwain-batch-file-example","status":"publish","type":"post","link":"http:\/\/www.gssezisoft.com\/main\/2015\/01\/another-cmdtwain-batch-file-example\/","title":{"rendered":"Another CmdTwain Batch File Example"},"content":{"rendered":"<p>Here&#8217;s another batch file example. It includes the date and time in the filename of scanned files.<br \/>\n<!--more--><br \/>\nAside from the benefit of keeping that useful information with the file, it also allows you to scan a bunch of pages without having to rename each file as you scan.<\/p>\n<p>The &#8220;set datetimef=&#8230;&#8221; line controls the actual format of the datetime stamp. Some may wish to use &#8220;%year%-%month%-%day%T%hour%%min%%secs%&#8221;.<\/p>\n<p>I personally use &#8220;%year%%month%%day%.%hour%%min%&#8221; in other projects; but only for consistency with a choice made long ago &#8211; the use of standard separators (as in the example) or an international format will make your life easier in the long run.<\/p>\n<p>Thank you to Jonas Schmuttermair for providing the example. I hope many of you find it useful.<\/p>\n<div style=\"width: 600; border: 1px solid black; overflow: scroll;\">\n<pre>\r\n@echo off\r\nset hour=%time:~0,2%\r\nif \"%hour:~0,1%\" == \" \" set hour=0%hour:~1,1%\r\n\r\nset min=%time:~3,2%\r\nif \"%min:~0,1%\" == \" \" set min=0%min:~1,1%\r\n\r\nset secs=%time:~6,2%\r\nif \"%secs:~0,1%\" == \" \" set secs=0%secs:~1,1%\r\n\r\nset year=%date:~-4%\r\n\r\nset month=%date:~3,2%\r\nif \"%month:~0,1%\" == \" \" set month=0%month:~1,1%\r\n\r\nset day=%date:~0,2%\r\nif \"%day:~0,1%\" == \" \" set day=0%day:~1,1%\r\n\r\nset datetimef=%year%_%month%_%day%_%hour%_%min%_%secs%\r\n\r\ncd %ProgramFiles(x86)%\\GssEziSoft\\cmdtwain\r\n\r\ncmdtwain.exe C:\\input\\%datetimef%.jpg\r\n\r\n<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<h2>Disclaimer<\/h2>\n<p>The example provided here is free of charge but it is also without warranty of any kind. The user is responsible for determining its suitability or otherwise for their particular needs. Neither the authors, nor GssEziSoft, accept liability for any problems arising out of the use of the example program.<\/p>\n<h1>Download the Example<\/h1>\n<p>Right click and Save the <a href=\"http:\/\/www.gssezisoft.com\/Products\/CmdTwain\/Examples\/eg0003.txt\" target=\"_blank\">example code<\/a>.<\/p>\n<h1>Download CmdTwain<\/h1>\n<p>You can also <a href=\"http:\/\/www.gssezisoft.com\/main\/get-cmdtwain-free\/\">download CmdTwain<\/a> for free.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s another batch file example. It includes the date and time in the filename of scanned files.<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[7,38],"tags":[],"_links":{"self":[{"href":"http:\/\/www.gssezisoft.com\/main\/wp-json\/wp\/v2\/posts\/1699"}],"collection":[{"href":"http:\/\/www.gssezisoft.com\/main\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gssezisoft.com\/main\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gssezisoft.com\/main\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gssezisoft.com\/main\/wp-json\/wp\/v2\/comments?post=1699"}],"version-history":[{"count":0,"href":"http:\/\/www.gssezisoft.com\/main\/wp-json\/wp\/v2\/posts\/1699\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.gssezisoft.com\/main\/wp-json\/wp\/v2\/media?parent=1699"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gssezisoft.com\/main\/wp-json\/wp\/v2\/categories?post=1699"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gssezisoft.com\/main\/wp-json\/wp\/v2\/tags?post=1699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}