Jump to content

rumwait syntax


Recommended Posts

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

  • Developers

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

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 by VIP

Regards,
 

Link to comment
Share on other sites

  • Developers
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

  • Developers

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

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

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 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

  • Developers
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 

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

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...