Jump to content

Not working if launched by PsExec on remote PC


Recommended Posts

  • Moderators

@MikhsilSV What if you run PSEXEC with the -i (interactive) switch in addition to -s?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

This is my normal command line layout for psexec..

 

psexec \\Computername -accepteula -i -c -f MyApp.exe

(in addition to what JLogan3o13 said )

Works every time

 

-accepteula This flag supresses the display of the license dialog.

-c         Copy the specified program to the remote system for
           execution. If you omit this option the application
           must be in the system path on the remote system.
           
 -i         Run the program so that it interacts with the desktop of the
            specified session on the remote system. If no session is
            specified the process runs in the console session.
            
 -f         Copy the specified program even if the file already
           exists on the remote system.

 

Edited by Kovacic

C0d3 is P0etry( ͡° ͜ʖ ͡°)

Link to comment
Share on other sites

  • Developers

Doubt the SEND() command will work when running with different credentials on the target machine. 

Might want to try ControlSend() or ControlClick()

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

If you want to run it as someone else, you can always hard code the creds.. I use this to elevate permissions for certain apps. Just know if the PW expires, you will have to recompile..

 

If NOT isadmin() Then
        RunAs("Administrator","MyDomain", "MyAdminPassword", 0, @ScriptFullPath & " on", "", @SW_SHOWMINIMIZED)
        Exit
EndIf

 

This will cause the script to relaunch under new creds, that may help.

C0d3 is P0etry( ͡° ͜ʖ ͡°)

Link to comment
Share on other sites

  • Moderators

Jos is of course correct, I missed that you were doing a Send rather then ControlSend. If you are unable to interact with the window controls, you are going to find it nigh impossible to run remotely.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Sorry for long time. I encount several issues while enforcing to work unattend installation of foobar2000 v1.3.9

I try to solve it by suggestions from this topic and my ideas, a lot of things. With no success.

My last version of script (unwork, even by doubleclecking it):

Local $vCaption = "foobar2000 v1.3.9 Setup"
Local $SRC = "\\Server\someshare\foobar2000_v1.3.9.exe"

RunWait($SRC)
sleep(300) ;just for any case
Local $hWnd=WinWaitActive($vCaption, "&Next >", 500)
;Send("!n") ;i tryes this first
Local $R=ControlClick($hWnd,"","[CLASSNN:Button2]")
if $R==0 then
   Exit(-5)
endif

WinWaitActive($vCaption, "I &Agree")
Send("!a")

WinWaitActive($vCaption, "&Next >")
Send("!n")

WinWaitActive($vCaption, "&Next >")
Send("!n")

WinWaitActive($vCaption, "&Install")
Send("!i")

WinWaitActive($vCaption, "&Run foobar2000")
Send("!r")

WinWaitActive($vCaption, "&Finish")
Send("!f")

I work on Win7 x64 Sp1+Ups if it something means

Can anyone write working scritp??? This one app is not life-critical, but i want how to fight with similar issues

Also tries clicking on TButton-s in super-simple GUI APP created & compiled in Lazarus, it s completely unclickable!

Link to comment
Share on other sites

MikhsilSV,

foobar2000 has /s switch for silent install. have you tried it?

(requires elevation of course, but PsExec handles that for you, with the -h switch)

B.T.W. welcome to AutoIt and to the forum!

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

MikhsilSV,

foobar2000 has /s switch for silent install. have you tried it?

This is cause  why i throw a glance on AutoIt side. Some apps has broken silent install ability, some has unneded payload enabled by default.

Edited by MikhsilSV
Link to comment
Share on other sites

i just downloaded and installed silently (Win10 elevated command prompt with /S switch) the latest stable release (v1.3.9).

i see no junk payload.

i did notice this: the switch is case-sensitive, i.e. should be /S not /s.

EDIT: also works over PsExec.

 

Edited by orbs
additional information

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

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

×
×
  • Create New...