{"id":341,"date":"2008-03-09T01:40:00","date_gmt":"2008-03-09T09:40:00","guid":{"rendered":"https:\/\/kb.terabyteunlimited.com\/kb-articles\/image-for-windows-fails-to-run-when-invoked-by-the-windows-task-scheduler\/"},"modified":"2021-09-10T23:44:42","modified_gmt":"2021-09-11T06:44:42","slug":"image-for-windows-fails-to-run-when-invoked-by-the-windows-task-scheduler","status":"publish","type":"lsvr_kba","link":"https:\/\/www.terabyteunlimited.com\/kb\/kb-articles\/image-for-windows-fails-to-run-when-invoked-by-the-windows-task-scheduler\/","title":{"rendered":"Image for Windows Fails to Run when Invoked by the Windows Task Scheduler"},"content":{"rendered":"<p><strong>Please note: <\/strong>This article applies to version 1 product(s) only.<\/p>\r\n<p><strong>Problem:<\/strong><\/p>\r\n<p>While attempting to run Image for Windows using the Windows Task Scheduler <em>without<\/em> the applicable user logged on (i.e. the user under whose context the task is running), the process doesn't seem to run at all.\u00a0 Or, the process starts, but Image for Windows (<span style=\"font-family: Courier New;\">imagew.exe<\/span>) seems to hang indefinitely.<\/p>\r\n<p><strong>Cause:<\/strong><\/p>\r\n<p>Image for Windows is waiting for user input, but the prompt is not visible due to the process having been invoked by the Task Scheduler.<\/p>\r\n<p><strong>Solution:<\/strong><br \/>\r\n<br \/>\r\nUse the Image Auto Response option of the <span style=\"font-family: Courier New;\">IFW<\/span> environment variable, as outlined in the <a href=\"http:\/\/www.terabyteunlimited.com\/downloads\/ifw_manual.pdf\">Image for Windows PDF manual<\/a>.\u00a0 The recommended method for doing this is to run Image for Windows from a <a href=\"http:\/\/www.terabyteunlimited.com\/downloads\/IFWBatch.zip\">command script<\/a>, using commands similar to the following:<br \/>\r\n<br \/>\r\n<span style=\"color: #0000ff; font-family: Courier New;\">setlocal<br \/>\r\nset IFW=IAR:Y<\/span><\/p>\r\n<ul>\r\n\t<li>The <span style=\"font-family: Courier New;\">setlocal<\/span> command serves to localize the environment variable to the script being run.\u00a0 That is, any environment variables specified after the <span style=\"font-family: Courier New;\">setlocal<\/span> command will not be in effect anywhere on the system but the script itself, and only when the script is running.\u00a0 This is an important consideration if you run Image for Windows interactively, and might not want the environment variable to be in effect.\u00a0 You can, if desired, explicitly specify the <span style=\"font-family: Courier New;\">endlocal <\/span>command, which will end script localization.\u00a0 If you do not supply the <span style=\"font-family: Courier New;\">endlocal <\/span>command, it will be implied automatically when the script is terminated.<br \/>\r\n<br \/>\r\n<\/li>\r\n\t<li>The <span style=\"font-family: Courier New;\">set IFW=IAR:Y<\/span> command will establish the Image Auto Response option, so that prompts will be replied to automatically.<br \/>\r\n<br \/>\r\n<\/li>\r\n\t<li>If you are using the <a href=\"http:\/\/www.terabyteunlimited.com\/downloads\/IFWBatch.zip\">Image for Windows batch process scripts<\/a> provided, you do not need to specify <span style=\"font-family: Courier New;\">setlocal<\/span> on your own.\u00a0 The scripts already include this command.\u00a0 The scripts also provide a location for setting the <span style=\"font-family: Courier New;\">IAR <\/span>option.\u00a0 Please read the documentation included with the scripts.<\/li>\r\n<\/ul>\r\n<p>If you are using the PHYLock add-on with Image for Windows, you may want to configure the Image Auto Response option to handle potential <strong>Unable to obtain a lock<\/strong> [Abort\/Ignore\/Retry] prompts.\u00a0 This is done simply by adding either an <span style=\"font-family: Courier New;\">A <\/span>(to Abort), an <span style=\"font-family: Courier New;\">I<\/span> (to Ignore), or an <span style=\"font-family: Courier New;\">R <\/span>(to Retry) to the <span style=\"font-family: Courier New;\">IAR <\/span>option.\u00a0 For example:<br \/>\r\n<br \/>\r\n<span style=\"color: #0000ff; font-family: Courier New;\">setlocal<br \/>\r\nset IFW=IAR:YA<br \/>\r\n<\/span><br \/>\r\nGenerally, if you are running Image for Windows (with PHYLock) non-interactively, you will either want to use <span style=\"font-family: Courier New;\">A <\/span>(to Abort) or <span style=\"font-family: Courier New;\">I<\/span> (to Ignore).\u00a0 If you specify <span style=\"font-family: Courier New;\">A<\/span>, the imaging process will abort if an <strong>Unable to obtain a lock<\/strong> [Abort\/Ignore\/Retry] prompt occurs.\u00a0 If you specify <span style=\"font-family: Courier New;\">I<\/span>, the imaging process will proceed, but <em>without<\/em> the use of PHYLock.<br \/>\r\n<br \/>\r\nPlease also note that if you have experienced the issue addressed by this article, there may be applicable <span style=\"font-family: Courier New;\">imagew.exe <\/span>and\/or <span style=\"font-family: Courier New;\">cmd.exe<\/span> process(es) running in the background.\u00a0 If this is the case, you may either terminate these process(es) using Task Manager, or simply reboot.<\/p>","protected":false},"excerpt":{"rendered":"<p>Please note: This article applies to version 1 product(s) only. Problem: While attempting to run Image for Windows using the Windows Task Scheduler without the applicable user logged on (i.e. the user under whose context the task is running), the process doesn&#8217;t seem to run at all.\u00a0 Or, the process starts, but Image for Windows [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"lsvr_kba_cat":[1818],"lsvr_kba_tag":[2118],"class_list":["post-341","lsvr_kba","type-lsvr_kba","status-publish","hentry","lsvr_kba_cat-ifd-ifl-ifw-version-1-archive","lsvr_kba_tag-archived"],"_links":{"self":[{"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/lsvr_kba\/341","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/lsvr_kba"}],"about":[{"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/types\/lsvr_kba"}],"author":[{"embeddable":true,"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/comments?post=341"}],"version-history":[{"count":2,"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/lsvr_kba\/341\/revisions"}],"predecessor-version":[{"id":6761,"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/lsvr_kba\/341\/revisions\/6761"}],"wp:attachment":[{"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/media?parent=341"}],"wp:term":[{"taxonomy":"lsvr_kba_cat","embeddable":true,"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/lsvr_kba_cat?post=341"},{"taxonomy":"lsvr_kba_tag","embeddable":true,"href":"https:\/\/www.terabyteunlimited.com\/kb\/wp-json\/wp\/v2\/lsvr_kba_tag?post=341"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}