Followers 0

runwait /c flag

3 posts in this topic

#1 ·  Posted (edited)

Hello,

For quite a long time i have been wondering something:

I quite frequently use the command

RunWait(@ComSpec & " /c " & "commandName")

Now i'm wondering: what does the /c flag do?

i apologize if the /c flag is not related to runwait as i put it like that in the title.

Edit: Is it even a flag?

thanks,

dh

Edit2: Never mind, I've found the answer:

/C Carries out the command specified by the string and then terminates

You can get all the cmd command line switches by typing cmd /?

I thought it was a flag from AutoIT but apparently it was a CMD thingy.

Edited by dragonheard

Share this post

Share on other sites

Thanks has a lot of info

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

• Similar Content

• By StMaSi
I'm attempting to code a Run or RunWait command that is a little on the long side and contains multiple sets of embedded quotes (as it would be issued from a CMD prompt), but can't for the life of me figure out the containing quotes as pertains to AutoIt. Here's the one-line command as it would be issued via a CMD prompt...
"\\AppServ\G$\Connectivity\Clients\Citrix\Receiver\14.5.0.10018\CitrixReceiver.exe" ADDLOCAL="ReceiverInside,ICA_Client,WebHelper,SSON,AM,SELFSERVICE,USB,DesktopViewer,Flash,Vd3d" ALLOWADDSTORE=A ALLOWSAVEPWD=A ENABLEPRELAUNCH=Y ENABLE_SSON=Yes STORE0="AppStore;https://receiver.domain.net/Citrix/Apps/discovery;on;AppStore" /EnableCEIP=false /includeSSON /noreboot /silent I've tried so many different combinations of surrounding quotes with Run and RunWait, I just don't understand why it's this difficult to get past this. Can anyone assist with this? Thank you. • By WannaBeGut Hello, I just wrote a script that should copy data into my cloud using xcopy (cmd), but I want the Status Bar I have in my GUI to change it's text like that: working. -> working.. -> working... -> working. ... I would also like to make a button which interrupts xcopy (simply closing it should do the trick), but I don't know how to call ProcessClose("xcopy.exe") using a button, while I'am waiting for RunWait to finish. Example:$command = 'xcopy "' & @DesktopDir & '\text.txt"' & ' "\\ADMIN-CLOUD\private\" /EECHIY' $SW_STATE = @SW_HIDE RunWait(@ComSpec & " /c " & '"' &$command & '"', @DesktopDir, $SW_State) Please tell me if you need any further information! • By ur I have written a script to build the Installshield project file(.ism) to setup files(.msi or .exe based on the release settings..). So when the user runs the script the process will be automatic for multiple ism files. Func Build($sOutputIsm,$ReleaseName,$sFilePath="None",$NewName="None") ;build the ism to get the msi If not FileExists($sOutputIsm) Then Logging("File Not Found: $sOutputIsm$",4) MsgBox($MB_OK +$MB_ICONERROR, "Error", "Could not find file ""$sOutputIsm$"".") Return EndIf Logging("Started Building $sOutputIsm$",4) ShowTrayTip($AppName, "Started Building$sOutputIsm$", 10,$TIP_ICONASTERISK) Dim $sBuildExe,$sBuildCommand,$Ret$sBuildExe = FindFileInPath("ISCmdBld.exe", "%ProgramFiles(x86)%\InstallShield") $sBuildCommand = """$sBuildExe$"" -p ""$sOutputIsm$"" -r ""$ReleaseName$"" -s" ;MsgBox(0,"",$sBuildCommand) $Ret = RunWait($sBuildCommand) If $Ret <> 0 Then ShowTrayTip($AppName,"ISM Build Failed, Please build the ISM Manually.",10, $TIP_ICONHAND) MsgBox($MB_OK + $MB_ICONERROR, "Error", "Could not build ""$sOutputIsm$"". Please build manually.") Logging("Error$Ret$while Building$sOutputIsm$",4) Return;Exit(1) Else ShowTrayTip($AppName,"ISM Build Completed",10, $TIP_ICONASTERISK) Logging("Completed Building$sOutputIsm$",4) if not StringCompare($NewName, "None")=0 then MoveEXE($sFilePath,$NewName) EndIf EndFunc The problem is when we run the ISCmdBuild.exe the RunWait will give whether fail or success but not what are the errors we got.
If we use Run, it will give that logging but we don't have the feature of getting fail/success as RunWait.
If we run the above code by removing -s and using redirection operator > to a file, it is running manually but failing with autoit.
Like

$sBuildCommand = """$sBuildExe$"" -p ""$sOutputIsm$"" -r ""$ReleaseName$"" > c:\logs\uday.log" Any help on this?? And also, in some machines the installshield shortcut is launching fine as licensed version but with ISCmdBld.exe it is giving error as licensing info missing or not registered. Any suggestion on this too?? • By Eggsplorer Hi, I want to install chocolatey (https://chocolatey.org/) with AutoIt. I just need to send the following command to cmd: @powershell -NoProfile -ExecutionPolicy unrestricted -Command "(iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))) >$null 2>&1" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin This is what I tried:
RunWait(@ComSpec & " /C " "@powershell -NoProfile -ExecutionPolicy unrestricted -Command "(iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))) >$null 2>&1" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin", ""); It didn't work propably because of the quotes. So I tried this:$code1 = "@powershell -NoProfile -ExecutionPolicy unrestricted -Command" $code2 = " (iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))) >$null 2>&1" $code3 = " && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" RunWait(@ComSpec & " /C " &$code1 & $code2 &$code3, ""); Didn't work either.
Any help?
Thanks in advance =)
• By rbenner1184
Hello,
I am ready to rip my hair out at this point I am not knew to autoit or scripting at all and that is why I am failing to understand what I am doing wrong here. When i run the command in the command prompt the command executes successfully as it should, but when i attempt to run this code in autoit nothing seems to happen. I am really failing to realize why, becuase I use Runwait to run command line parameters all the time. Can some one please help me out here and show me why this will not work for me. The script is uninstalling java and obviously i need to have this for many different versions of java, but lets just get this one working first. Any ideas? thanks.
#RequireAdmin $WinDir = "C:\Windows\System32" RunWait($WinDir & "\taskkill /f /im java.exe /T") RunWait($WinDir & "\taskkill /f /im javaw.exe /T") RunWait($WinDir & "\taskkill /f /im javaws.exe /T") RunWait($WinDir & "\taskkill /f /im jqs.exe /T") RunWait($WinDir & "\taskkill /f /im jusched.exe /T") RunWait($WinDir & "\taskkill /f /im iexplore.exe /T") RunWait($WinDir & "\taskkill /f /im firefox.exe /T") ;REM Uninstall v1.4.2_19 RunWait(\$WinDir & "\MsiExec.exe /x {7148F0A8-6813-11D6-A77B-00B0D0142190} /qb /norestart")