{"id":434,"date":"2019-04-26T16:42:15","date_gmt":"2019-04-26T08:42:15","guid":{"rendered":"http:\/\/www.yohz.com\/blogs\/?p=434"},"modified":"2019-04-26T16:42:15","modified_gmt":"2019-04-26T08:42:15","slug":"running-the-sql-image-viewer-command-line-interface-in-batch-files","status":"publish","type":"post","link":"https:\/\/www.yohz.com\/blogs\/2019\/04\/26\/running-the-sql-image-viewer-command-line-interface-in-batch-files\/","title":{"rendered":"Running the SQL Image Viewer command line interface in batch files"},"content":{"rendered":"<p>The <a href=\"https:\/\/www.yohz.com\/siv8_details.htm\">SQL Image Viewer<\/a> Professional Edition includes a <a href=\"https:\/\/www.yohz.com\/help\/sqlblobviewer\/index.htm\">command-line interface<\/a> that you can use to run your export jobs unattended.\u00a0 If you use batch files to run your export jobs, you would need to ensure that the working directory is folder where the SQL Image Viewer command-line executable (SQLImageViewerCmd.exe) is located.<\/p>\n<p>So say the executable files are located in this folder:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-435\" src=\"http:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2019\/04\/cmdline01.png\" alt=\"\" width=\"781\" height=\"276\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2019\/04\/cmdline01.png 781w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2019\/04\/cmdline01-300x106.png 300w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2019\/04\/cmdline01-768x271.png 768w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2019\/04\/cmdline01-624x221.png 624w\" sizes=\"(max-width: 781px) 100vw, 781px\" \/><\/p>\n<p>Our batch file (which is in another folder) calls the executable, and provides the export definitions as the first parameter.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-436\" src=\"http:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2019\/04\/cmdline03.png\" alt=\"\" width=\"832\" height=\"58\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2019\/04\/cmdline03.png 832w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2019\/04\/cmdline03-300x21.png 300w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2019\/04\/cmdline03-768x54.png 768w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2019\/04\/cmdline03-624x44.png 624w\" sizes=\"(max-width: 832px) 100vw, 832px\" \/><\/p>\n<p>This is the error that will be raised when we run the batch file.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-437\" src=\"http:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2019\/04\/cmdline02.png\" alt=\"\" width=\"741\" height=\"276\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2019\/04\/cmdline02.png 741w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2019\/04\/cmdline02-300x112.png 300w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2019\/04\/cmdline02-624x232.png 624w\" sizes=\"(max-width: 741px) 100vw, 741px\" \/><\/p>\n<p>This is because the working directory is the folder where the batch file is located.\u00a0 To fix this issue, use the CD command with the \/N flag in the batch file to set the working directory to the SQL Image Viewer folder i.e.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-438\" src=\"http:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2019\/04\/cmdline04.png\" alt=\"\" width=\"846\" height=\"84\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2019\/04\/cmdline04.png 846w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2019\/04\/cmdline04-300x30.png 300w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2019\/04\/cmdline04-768x76.png 768w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2019\/04\/cmdline04-624x62.png 624w\" sizes=\"(max-width: 846px) 100vw, 846px\" \/><\/p>\n<p>In this way, when SQL Image Viewer runs, it can find all the files that it requires to run successfully.<\/p>\n<div class=\"fcbkbttn_buttons_block\" id=\"fcbkbttn_left\"><div class=\"fcbkbttn_like \"><fb:like href=\"https:\/\/www.yohz.com\/blogs\/2019\/04\/26\/running-the-sql-image-viewer-command-line-interface-in-batch-files\/\" action=\"like\" colorscheme=\"light\" layout=\"button\"  size=\"small\"><\/fb:like><\/div><div class=\"fb-share-button  \" data-href=\"https:\/\/www.yohz.com\/blogs\/2019\/04\/26\/running-the-sql-image-viewer-command-line-interface-in-batch-files\/\" data-type=\"button\" data-size=\"small\"><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>The SQL Image Viewer Professional Edition includes a command-line interface that you can use to run your export jobs unattended.\u00a0 If you use batch files to run your export jobs, you would need to ensure that the working directory is folder where the SQL Image Viewer command-line executable (SQLImageViewerCmd.exe) is located. So say the executable [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[5,11],"tags":[12],"_links":{"self":[{"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/posts\/434"}],"collection":[{"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/comments?post=434"}],"version-history":[{"count":1,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/posts\/434\/revisions"}],"predecessor-version":[{"id":439,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/posts\/434\/revisions\/439"}],"wp:attachment":[{"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/media?parent=434"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/categories?post=434"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/tags?post=434"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}