mmoore5553 Posted April 30, 2021 Share Posted April 30, 2021 I need help with getting syntax correct. I read the documentation but confused on how to write a certain script if i run aAMD_Chipset_Drivers.exe and need these parameters /S /v/qn how do i set that up in autoscript editor. I have tried many combinations but keeps failing to compile or run the example in the help does not have any parameters this is what i was trying RunWait("C:\AMD_Chipset_Drivers.exe /S,""," /v/qn"") I tried using the search and it failed me too. Link to comment Share on other sites More sharing options...
Developers Jos Posted April 30, 2021 Developers Share Posted April 30, 2021 Specify all parameters in the initial parameter, like you would when running it from the command prompt. 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 More sharing options...
Danp2 Posted April 30, 2021 Share Posted April 30, 2021 mmoore5553 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Trong Posted April 30, 2021 Share Posted April 30, 2021 (edited) It will run like this: Local $sDriversPath = 'C:\AMD_Chipset_Drivers.exe' ; Silent installation with default settings RunWait('"' & $sDriversPath & '" /s /v"/qn"', "", @SW_HIDE) ; Silent installation with default settings and no reboot RunWait('"' & $sDriversPath & '" /s /v"/qn /norestart "', "", @SW_HIDE) Edited May 1, 2021 by VIP Regards, Link to comment Share on other sites More sharing options...
Subz Posted April 30, 2021 Share Posted April 30, 2021 Think it should be something like: nb: without /norestart the system may reboot automatically, you can remove if this is the behavior you're after. RunWait('"C:\AMD_Chipset_Drivers.exe" /S /v" /qn /norestart"',"",@SW_HIDE) Link to comment Share on other sites More sharing options...
mmoore5553 Posted April 30, 2021 Author Share Posted April 30, 2021 odd VIP that did not work. Link to comment Share on other sites More sharing options...
Developers Jos Posted April 30, 2021 Developers Share Posted April 30, 2021 13 minutes ago, mmoore5553 said: odd VIP that did not work. Specify for us the working command you type on the command prompt and we can show you how you comply convert that to a run() statement) It could be that runwait doesn't work when it reshells with elivated rights. 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 More sharing options...
mmoore5553 Posted April 30, 2021 Author Share Posted April 30, 2021 i go to the command prompt and type C:\AMD_Chipset_Drivers.exe /S /v/qn Link to comment Share on other sites More sharing options...
Developers Jos Posted April 30, 2021 Developers Share Posted April 30, 2021 then simply try: runwait(@comspec & ' /c C:\AMD_Chipset_Drivers.exe /S /v/qn') When it gives issues you change the /c to /k to leave the cmd window open and see if there is a message. 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 More sharing options...
Trong Posted May 1, 2021 Share Posted May 1, 2021 Try This: Local $sDriversPath = 'C:\AMD_Chipset_Drivers.exe' ; # Silent installation with default settings ;~ Local $output = _RunCmd_GetOutput('"' & $sDriversPath & '" /s /v"/qn"') ; # Silent installation with default settings and no reboot Local $output = _RunCmd_GetOutput('"' & $sDriversPath & '" /s /v"/qn /norestart "') MsgBox(0, "Return", $output) Func _RunCmd_GetOutput($sCommand) ConsoleWrite("+Execute: " & $sCommand & @CRLF) Local $sOutput = '', $iPID = Run('"' & @ComSpec & '" /c ' & $sCommand, '', @SW_HIDE, 0x8) ; $STDERR_MERGED (0x8) Do $sOutput &= StdoutRead($iPID) Until @error Do $sOutput &= StderrRead($iPID) Until @error ConsoleWrite($sOutput & @CRLF) Return $sOutput EndFunc ;==>_RunCmd_GetOutput Regards, Link to comment Share on other sites More sharing options...
Subz Posted May 1, 2021 Share Posted May 1, 2021 Would also add #RequireAdmin to the script? Link to comment Share on other sites More sharing options...
Trong Posted May 1, 2021 Share Posted May 1, 2021 3 minutes ago, Subz said: Would also add #RequireAdmin to the script? Sure! That is required to install drivers! Regards, Link to comment Share on other sites More sharing options...
JockoDundee Posted May 1, 2021 Share Posted May 1, 2021 (edited) 5 hours ago, Jos said: then simply try: @Jos, curious why you and others use @ComSpec to run the program, instead of just the command and the args. My understanding was that @ComSpec needed to be run when you need the command interpreter to process something, for instance an internal command, or redirection or piping. Is it because it provides debug info via /k ? Do you remove it after debugging? Thx! Edited May 1, 2021 by JockoDundee eliminated reference to command.com after realizing the reference dates me Code hard, but don’t hard code... Link to comment Share on other sites More sharing options...
Developers Jos Posted May 1, 2021 Developers Share Posted May 1, 2021 4 hours ago, JockoDundee said: @Jos, curious why you and others use @ComSpec to run the program, instead of just the command and the args. As that simulates running the command from the cmd prompt, which often works better with commandline utilities. For it makes life simpler as I asked what works from the commandline and then you simply "should be able to " run it this way. Jos JockoDundee 1 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 More sharing options...
mmoore5553 Posted May 3, 2021 Author Share Posted May 3, 2021 thank you jos. that worked perfectly. 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