Jump to content

Running AutoIt with psexec


Recommended Posts

I have a Autoit program that does a simple test on a local machine.

I want to run this test on all remote servers connected to the network, so I use psexec to distribute the compiled autoit scripts

It seems this only works when I am logged in to the remote machine, either physically or remotely.

I am running this test after an automatic restart on each computer, so I will always be logged off when this script runs, so in this case the script will hang execution until I log on.

Is there something in AutoIt or Psexec to sidestep this?

Thanks.

Link to comment
Share on other sites

Usually these are the psexec hangups.

NTLM negotiation mismatch

Classic Windows Filesharing turned on, and firewall allowing it

2k3/XP/2k/NT's Forceguest

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa]

"forceguest"=dword:00000000

Vista's Forceguest Equivalent

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]

"LocalAccountTokenFilterPolicy"=dword:00000001

If you can do this, psexec should work as advertised.

net use \\target\Admin$ /user:Administrator 
dir \\target\Admin$ 
net use \\target\Admin$ /delete (end the session)

In your case it sounds like something I just ran into with AutoIt.

Most launchers, including psexec aren't going to drop you into the Winlogon desktop.

Instead they'll run the app invisible.

For example, psexec-ing cmd.exe with the '-i' immediately gives you a networked prompt, but the window isn't visible until a user logs on.

Without the '-i' it starts immediately too but will never be visible.

You can check by psexec-ing notepad.exe, and while that's running, psexec a cmd.exe to run the tasklist command.

Repeat: AutoIt will run but you can't see it.

If you don't do anything a user would see (popups, or window manipulation, or hotkeys, etc), you don't need 'interact with desktop'. In other words stick to messing with the registry, network, and files.

I made a script that sent 'hello world' over a socket to a separate PC and that worked without me logged in on the target.

If you need interaction and don't care whose desktop, or if anyone's logged in at all, this thread will help.

http://www.autoitscript.com/forum/index.php?showtopic=51337

Edited by RandomGuest
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...