Modify ↓
#309 closed Bug (Fixed)
runas() from a network path
| Reported by: | Owned by: | Valik | |
|---|---|---|---|
| Milestone: | 3.2.13.0 | Component: | AutoIt |
| Version: | 3.2.12.0 | Severity: | None |
| Keywords: | runas | Cc: |
Description
I have written a script that will elevate an uninstall process to admin credentials. This works nicely when run from a local drive. However when run from a network path, the scripts pauses.
RunAs Command line reads:
RunAs($Admin, @LogonDomain, $AdminPwd,1,@ComSpec & ' /c ' & $RemoveOld)
As I'm using the @ComSpec /c, when running from local drive the command line box appears. When running same script (absolutely no changes) from a network path, this command line box does not appear.
To get around this I have created a .cmd file that copies the script file from the network path to the local drive and run script locally. Bit of a bummer!
Attachments (0)
Change History (6)
comment:3 by , on May 25, 2008 at 5:35:46 AM
| Milestone: | → 3.2.13.0 |
|---|---|
| Owner: | set to |
| Resolution: | → Completed |
| Status: | new → closed |
Added in version: 3.2.13.0
comment:5 by , on May 25, 2008 at 5:37:24 AM
| Resolution: | Completed |
|---|---|
| Status: | closed → reopened |
comment:6 by , on May 25, 2008 at 5:37:29 AM
| Resolution: | → Fixed |
|---|---|
| Status: | reopened → closed |
Note:
See TracTickets
for help on using tickets.

You must specify a working directory the user you're running as has access to. You don't specify one so AutoIt uses it's current working directory. Since you're running from a network path AutoIt uses that network path as the working directory for the child process. The problem is, the user doesn't have access to that directory and so the process fails to start with an access denied error. Specify a directory the user has access to as the working directory and your code will work.