Jump to content
usera

PSexec MSI MST

Recommended Posts

usera

Greeting,

I have a command line as below:

c:\temp\psexec -accepteula -u domain\administrator -p Password1 msiexec /i "\\shareserever\Folder\qa.msi" TRANSFORMS="\\shareserver\Folder\qas.mst" /qn

it works no problem,

since it has password inside, I want to use autoit to do the same thing, but compile it to EXE file.

So here is the code I am using:

 

$username="domain\administrator"
$password="Password1"

runWait(@ComSpec & " /c " & "C:\temp\psexec.exe " & '-accepteula -u ' & $username & ' -p' & $password & ' msiexec /i ' & "\\shareserver\folder\qa.msi" & ' TRANSFORMS="\\shareserver\Folder\qa.mst" /qn')

 

Once run it, I got a black window show:

Could not access shareserver\folder\qa.msi :

the system cannot find the path specified.

 

Thanks and Best Regards,

usera

 

 

 

Share this post


Link to post
Share on other sites
Subz

Try something like, the following to check that the command is correct, I noticed that you didn't have a space between -p and password not sure if this was just a typo.

Try with and without #RequireAdmin, can't remember if you have to run CMD as Administrator.

#RequireAdmin
Global $sUserName="domain\administrator"
Global $sPassword="Password1"

Global $sCommandLine = @ComSpec & " /c C:\temp\psexec.exe -accepteula -u " & $sUserName & " -p " & $sPassword & ' MsiExec /i "\\shareserver\folder\qa.msi" TRANSFORMS="\\shareserver\Folder\qa.mst" /qn'
MsgBox(4096, "Command Line Switch", $sCommandLine) ;~ For debugging purposes
RunWait($sCommandLine)

 

  • Thanks 1

Share this post


Link to post
Share on other sites
usera
Posted (edited)
15 minutes ago, Subz said:

Try something like, the following to check that the command is correct, I noticed that you didn't have a space between -p and password not sure if this was just a typo.

Try with and without #RequireAdmin, can't remember if you have to run CMD as Administrator.

#RequireAdmin
Global $sUserName="domain\administrator"
Global $sPassword="Password1"

Global $sCommandLine = @ComSpec & " /c C:\temp\psexec.exe -accepteula -u " & $sUserName & " -p " & $sPassword & ' MsiExec /i "\\shareserver\folder\qa.msi" TRANSFORMS="\\shareserver\Folder\qa.mst" /qn'
MsgBox(4096, "Command Line Switch", $sCommandLine) ;~ For debugging purposes
RunWait($sCommandLine)

 

THANKS,

 

I did use you code try,

1. remove #RequireAdmin

2. Command Line Switch: show

   c:\windows\system32\cmd.exe /c C:\temp\psexec.exe -accepteula -u domain\administrator -p Password1 MsiExec /i "\\shareserver\folder\qa.msi" TRANSFORMS="\\shareserver\Folder\qa.mst" /qn

   looks right, then once I click ok, new black windows open then close

4. I add 2 line there

$result=RunWait($sCommandLine)
MsgBox(4096,"Result",$result)

The result is 1619.

but the applicaiton did not install.

any way I can pause ( trace ) the runwait command?

 

thanks

usera

----------------------------just add----------------------------

from command prompt, I run

C:\temp\psexec -accepteula -u domain\administrator -p Password1 msiexec /i "\\shareserver\folder\qa.msi" TRANSFORMS="\\shareserver\folder\qa.mst" /qn

I got:

PsExec v2.2 - Execute processes remotely
Copyright (C) 2001-2016 Mark Russinovich
Sysinternals - www.sysinternals.com

msiexec exited with error code 0.

C:\temp>

and applicaiton installed

 

 

 

 

Edited by usera
add info

Share this post


Link to post
Share on other sites
Earthshine

try not removing RequireAdmin. Also there should be a log file in the temp directory and you could read that log file and see what went wrong or if you post it I will analyze it

  • Thanks 1

My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
usera
Posted (edited)
5 minutes ago, Earthshine said:

try not removing RequireAdmin. Also there should be a log file in the temp directory and you could read that log file and see what went wrong or if you post it I will analyze it

 

Thanks Earthshine,

the idea is avoid RequireAdmin , So I have to that.

no log file(s) created, nor C:\windows\temp neither %temp%

Thanks for help

 

$result=RunWait($sCommandLine)
MsgBox(4096,"Result",$result)

The result is 1619.

 

 

Edited by usera
edit

Share this post


Link to post
Share on other sites
usera
5 minutes ago, usera said:

 

Thanks Earthshine,

the idea is avoid RequireAdmin , So I have to that.

no log file(s) created, nor C:\windows\temp neither %temp%

Thanks for help

 

$result=RunWait($sCommandLine)
MsgBox(4096,"Result",$result)

The result is 1619.

 

 

Thanks SUBZ and Earthshine, it working now, I did wrong typo.

 

Thanks !!! thanks!!! :)

 

 

  • Like 1

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

×