usera Posted June 7, 2018 Share Posted June 7, 2018 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 Link to comment Share on other sites More sharing options...
Subz Posted June 7, 2018 Share Posted June 7, 2018 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) usera 1 Link to comment Share on other sites More sharing options...
usera Posted June 7, 2018 Author Share Posted June 7, 2018 (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 June 7, 2018 by usera add info Link to comment Share on other sites More sharing options...
Earthshine Posted June 7, 2018 Share Posted June 7, 2018 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 usera 1 My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
usera Posted June 7, 2018 Author Share Posted June 7, 2018 (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 June 7, 2018 by usera edit Link to comment Share on other sites More sharing options...
usera Posted June 7, 2018 Author Share Posted June 7, 2018 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!!! Earthshine 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now