Jump to content
DrLarch

Autoit native function like PSEXEC?

Recommended Posts

DrLarch

I use psexec a LOT in my Autoit programs. But it is a pain dealing with as far as getting feedback. One can get feedback from the cmd line but it's clunky, and, AFAIK it's very difficult (impossible?) to get cmd line feedback running interactively (-i). Yeah, an Autoit exe can write data to a file (or even by sending back over the network) which can be read by a parent script, but that's clunky as well.

So is there any kind of native functionality available in Autoit for doing what PSEXEC does? I found this old thread which asked the same question (which went unanswered), so wanted to throw this out there again.

I have found out about a few other utilities like remcom (old and Sourceforge says it contains malware) and PSAEXEC (open source non-MS implementation of PSEXEC). But it would sure be nice if there was some way of doing this natively in Autoit.

Thanks

Edited by DrLarch

Share this post


Link to post
Share on other sites
orbs

psexec works by installing a service on the target machine, which runs under the local SYSTEM account. this service then executes a program (or communicate with the remote machine, or do pretty much anything). when the program exits, the service uninstalls itself.

each of these tasks can be written in pure AutoIt, then combined into a single utility.

good luck!

EDIT: or learn how to work with psexec, and deal with its limitations.

Edited by orbs

Share this post


Link to post
Share on other sites
DrLarch
11 hours ago, orbs said:

psexec works by installing a service on the target machine, which runs under the local SYSTEM account. this service then executes a program (or communicate with the remote machine, or do pretty much anything). when the program exits, the service uninstalls itself

Hmm... good to know. Thanks for that orbs. But regarding running as SYSTEM, I thought that only applied if using the -s switch. But maybe it always does run as SYSTEM, but launches the executable separately according to the psexec params (ie. -i [session])?

11 hours ago, orbs said:

each of these tasks can be written in pure AutoIt

I'm sure this can be done, but am under the impression that's a bit beyond me currently. That said, the paexec source is available and could be studied to determine the exact mechanisms used. Who knows, maybe if I get more time I can start digging into this. I was actually kind of wondering if any UDF's are out there already, but looks like that isn't the case. No big deal, though. I've already been playing with the TCP listen and send functions more. With those, it's looking very doable to get where I want to go. So like you said, short term I'm going to be working around psexec's limitations, and hopefully long term I can come up with something native.

11 hours ago, Chimp said:

... maybe something like this

Thanks Chimp. Wondering if WMI is what psexec is using to do its thing?

Share this post


Link to post
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

×