Jump to content



Photo

psexec & AutoIt = Black Window


  • Please log in to reply
2 replies to this topic

#1 Skinner

Skinner

    Seeker

  • Normal Members
  • 2 posts

Posted 28 February 2012 - 05:11 PM

I've googled the hell out of this and everything says I'm going it right.

I have an autoit script, and for sake of argument, let's say it's just simply (of which I have tried):
MsgBox(0, "test", "Test Message")


When running:
psexec \\remotecomputer -c -f -i myscript.exe

From a machine on a domain running under a domain administrator account.

The script gets passed to the remote machine, and executes and even displays on the current logged in user's screen but it's a black box.

You can see the menu bar on the MsgBox but if I build a GUI with no bars or anything, it's just a black box.

Either way, menu bar or not, you can't see what's going on.

Any suggestions?





#2 JLogan3o13

JLogan3o13

    Down to 98

  • MVPs
  • 2,103 posts

Posted 28 February 2012 - 06:18 PM

Hi, Skinner, welcome to the forum. I'm afraid it is not clear what you're looking for. Are you trying to get it to interact with the logged on user? If so, this works for me:

$asset = InputBox("RegExport", "Enter the asset tag.") $psexec = FileInstall("C:psexec.exe", "C:psexec.exe", 1) DirCreate('' & $asset & 'C$MyReg') ShellExecute("C:psexec.exe", '-i -s ' & $asset & ' REG EXPORT HKLMSoftwareODBC C:ODBC.reg', "", "", @SW_SHOW)


If you'd like it to happen silently, this works:

$asset = InputBox("RegExport", "Enter the asset tag.") $psexec = FileInstall("C:psexec.exe", "C:psexec.exe", 1) DirCreate('' & $asset & 'C$MyReg') ShellExecute("C:psexec.exe", '-s ' & $asset & ' REG EXPORT HKLMSoftwareODBC C:ODBC.reg', "", "", @SW_HIDE)

J.I spent 10 minutes reviewing code and thinking "What kind of drugs is this guy on?" before realizing it was something I wrote.My Scripts:Include Source with Compiled Script, Disk Maintenance for Windows XP, "Deal-A-Day" Sites, SCCM 2007 Front End, Windows Firewall UDF

#3 Skinner

Skinner

    Seeker

  • Normal Members
  • 2 posts

Posted 28 February 2012 - 06:31 PM

It looks like the -s was the trick. Thanks for the help.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users