title: Permission denied error when running VBScript via cscript.exe within PowerShell
body: <p>I am trying to run a VBScript via <code>cscript.exe</code> within PowerShell (by invoking command on a remote server).</p>
  
  <p>It keeps erroring out with a permissions error.</p>
  
  <p>Below is the command that is failing.</p>
  
  <pre class="lang-bsh prettyprint-override"><code>Invoke-Command -Computer testserver1 -ScriptBlock {
      Set-Location 'C:\Test1\Test2' |
          cscript.exe -NoLogo test_v1.03.vbs /anlyze:false /reboot:false
  }
  </code></pre>
  
  <p>In above command I'm invoking a command to change the directory to where the VBScript is located and then run the VBScript via <code>cscript.exe</code>.</p>
  
  <p>When I run the same command locally on the server in testserver1 it works fine, but when I invoke the same command on remote server, VBScript output file gives me a permission denied error.</p>
  
  <blockquote>
    <p>Error Report 2 - 70  Permission denied</p>
  </blockquote>
  
  <p>My user has full access on remote servers and the local server from where I am invoking the command.</p>
  
  <p>Is it <code>cscript.exe</code> or VBScript that is causing issue to me?</p>