Run BAT file as a Local User Account
<p>I pulled this from another question, but I cannot seem to make this work.</p>

<p>I need to run this .bat file as a local admin account.  I want users to be able to run and install this without having local admin rights.</p>

<p>I'm not sure what's wrong though.</p>

<pre><code>$username = 'localadmin'
$password = 'passwordforlocaladmin'
$securePassword = ConvertTo-SecureString $password -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential $username, $securePassword
Start-Process -Filepath "p:\kaceInstaller\kaceinstall3.bat" -Credential $credential
</code></pre>

<p>The error I'm getting back is:</p>

<pre>Start-Process : This command cannot be executed due to the error: The directory
name is invalid.
At P:\kaceInstaller\misc\kaceSetup.ps1:7 char:14
+ Start-Process &lt;&lt;&lt;&lt;  cmd -Credential $credential
    + CategoryInfo          : InvalidOperation: (:) [Start-Process], InvalidOperationException
    + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommandy</pre>