VBA code to Open .vbs file as another user
<p>I have searched thoroughly and have yet to find the right answer to this question.  Seems the methods below may be dated?</p>

<p>Here is the situation, I have an Access 2010 form with a button that executes a .vbs file that updates Active Directory user logon hours.  This file has to be run with my administrative account which uses an eToken cert and pin for authentication.  Therefore, I need to a windows user logon interface prompt.  Please provide a VBA code sample to if this is possible.</p>

<p>I've tried the following methods without success:</p>

<pre><code>Shell "runas.exe /user:administrator ""scriptname.vbs""", vbNormalFocus
</code></pre>

<p>and</p>

<pre><code>ShellExecute 0, "runas", "c:\folder\scriptname.vbs", Command, vbNullString, SW_SHOWNORMAL
</code></pre>