title: batch file from scheduled task returns code 2147942401
body: <p>I am trying to schedule a job to run a batch file with Windows 10 Task Scheduler, but it results in return code 2147942401.</p>
  
  <p>The batch file is on remote location so I am giving the absolute path<br>
  "\\server1\file transfers\data files\inbound\abc\csv\excel-to-csv.bat" </p>
  
  <p>If I run the batch script with command prompt then it work fine.
  <a href="https://i.stack.imgur.com/x3Mfv.png" rel="noreferrer"><img src="https://i.stack.imgur.com/x3Mfv.png" alt="Properties - General"></a>
  <a href="https://i.stack.imgur.com/gzfTG.png" rel="noreferrer"><img src="https://i.stack.imgur.com/gzfTG.png" alt="Actions - Edit Action"></a></p>
  
  <p>The batch script is to convert excel to file to csv.</p>
  
  <p>Content of the script is:</p>
  
  <pre><code>FOR /f "delims=" %%i IN ("\\server1\file transfers\Data Files\Inbound\abc\CSV\*.xlsx" ) DO to-csv.vbs  "\\server1\file transfers\Data Files\Inbound\abc\*.xlsx" "%%~ni.csv"
  </code></pre>
  
  <p>Its calling another VB script which is <code>to-cvs.vbs</code></p>
  
  <p>If i make changes in Action tab as mention by @Steinspecht(Task scheduler- task completed “successfully” with exit code 0x8007001) then also i am getting the code  2147942401
  <a href="https://i.stack.imgur.com/8N4vd.png" rel="noreferrer">Not sure whether Add a arguments is written correct</a><a href="https://i.stack.imgur.com/8N4vd.png" rel="noreferrer"><img src="https://i.stack.imgur.com/8N4vd.png" alt="enter image description here"></a></p>