Jump to content

Run/RunWait unexpected delay?


kami
 Share

Recommended Posts

Hello all,

I'm getting unexpected delay when using Run and RunWait commands,

but NOT always....

Let's say, 1 of 8 times.

I'm starting programs as user with admin priviledges (RunAsSet)

Also, I cannot start explorer.exe with other priviledges

(I've enabled explorer.exe to start as separate process).

I have all this in AutoIt v2, (Run, Runas.exe...; Sleep 2000; Send ....)

but I want to move it to AutoIt v3.

TNX in advance,

kami

Link to comment
Share on other sites

  • Administrators

The only reason I can think of is if you are using a domain account id and it is taking a while to authenticate. If you are using a local ID then try specifiying the user name like ".\username" - sometimes the .\ forces the local accounts to be checked.

Link to comment
Share on other sites

The only reason I can think of is if you are using a domain account id and it is taking a while to authenticate.  If you are using a local ID then try specifiying the user name like ".\username" - sometimes the .\ forces the local accounts to be checked.

Hmmm....

Probably I am doing something wrong.....

I am using RunAsSet("Administrator", @Computername, "password").

When I try to use ".\Administrator", I am getting AutoIt error;

When I try to use ".\" for computer name, I am getting Windows error....

I am always using local Administrator password.

Some computers are attached to domain, some in workgroup.

I am starting 4 programs (paths are removed):

- Defrag: "mmc.exe dfrg.msc";

- PowerControl: "control.exe powercfg.cpl";

- Ad-Aware: "Ad-aware.exe";

- Explorer: "explorer.exe /e,/root,""%USERPROFILE%\My Documents""".

Path and Enviroment variables are included in local variable, then added as string.

Registry is already modified to allow runnig explorer.exe as separate process.

All of this is working under AutoIt v2 with sequence:

Run,.....

Sleep, 2000

Send, password{ENTER}

Also,

When I try to start some other programs with admin priviledges, delay will occur.

Tray icon will appear, Task manager is showing the process is running.

Delay is approx. 30 sec.

I tried this on several computers.

All computers are running W2K + SP4.

RunAs Service is Automatic.

It seems that delay will occur only for first time.

Link to comment
Share on other sites

  • Administrators

It definately has all the marks of an authentication delay.

If you log on as a "normal" user and then try and map a drive to the local computer c$ share (using the admin credentials you've been using in autoit) how long does it take the first time?

Link to comment
Share on other sites

It definately has all the marks of an authentication delay.

If you log on as a "normal" user and then try and map a drive to the local computer c$ share (using the admin credentials you've been using in autoit) how long does it take the first time?

(Un)fortunately, I'll be able to test this after 5th of January.

I test it on computer at home,

I have normal respond for NET USE ... and for AutoIt scripts.

Problem with starting of explorer.exe is maybe related to profile.

Registry value is in HKCU.

When I'm starting explorer.exe with RunAs command, I am not using /profile switch.

(AutoIt v2 script)

Question:

When using RunAsSet command, which profile is active?

Current user or "RunAsSet" user?

Link to comment
Share on other sites

My first time out with RunAsSet() didn't work either. I walked over to a workstation and logged on and looked in "User&Passwords" area. I forgot that I renamed the local administrator accounts for security purposes. The @ComputerName is an AutoIT3 macro.

$LAA = " <LocalAdministratorAccount> "

$WN = @ComputerName

$LAP = " <password> "

RunAsSet($AcctName, $WkstName, $LocalPass)

RunWait("mmc.exe dfrg.msc", " < path> ", "")

RunWait("control.exe powercfg.cpl", " < path> ", "")

;Memory Flush

$LAA = 0

$WN = 0

$LAP = 0

RunAsSet()

Using the Local Adminsitrator account on a remote machine will be faster since authentication will occur locally on the remote workstation. Additionally, I've got one script on all of my workstations, in the "All Users\Programs\Startup" folder to run scripts located on the server. Script upkeep is greatly reduced and I spend zero time on my feet walking to and from workstations.

I no longer use a Domain Administrator account because I've read they can be a security risk. I recommend compiling the script to prevent others from gaining the local Admin privileges to your workstations.

Link to comment
Share on other sites

  • 1 month later...

Hmm.... Still the same problem:

Compiled script is executing normally.

First time, second time. After few times, I am getting that 30-40 seconds delay when I start the script. Then again is working/starting normally without delay...

During that delay period, I can see AutoIt icon in system tray.

Script is compiled with the latest version of AutoIt.

Tested on 10-15 computers, all computers are Windows 2000 SP4 + latest security updates. All computers are deployed with sysprep pnp image.

Some of computers are on domain, some of them are in workgroup.

If you log on as a "normal" user and then try and map a drive to the local computer c$ share (using the admin credentials you've been using in autoit) how long does it take the first time?

NET USE W: \\%COMPUTERNAME%\C$ /user:%COMPUTERNAME%\Administrator

Mapping has normal respond.

Here is one of problematic scripts:

Dim $SysDir
Dim $Command

$SysDir  = EnvGet("SystemRoot")
$Command = $SysDir & "\system32\mmc.exe " & $SysDir & "\system32\dfrg.msc"

Break(0)

AutoItSetOption("RunErrorsFatal", 0)

RunAsSet("Administrator", @Computername, "password")
Run($Command, $SysDir,)

This is full script, not part of it. Script is starting Disk Defragmenter as Administrator...

I do not have any more ideas what can be wrong.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...