fabianenos Posted May 9, 2008 Posted May 9, 2008 I need to execute a command line application and have its output stored in a variable. I also don't want this windows displayed. eg: ping www.google.com Is there any way to do this?
Greenhorn Posted May 9, 2008 Posted May 9, 2008 I need to execute a command line application and have its output stored in a variable. I also don't want this windows displayed. eg: ping www.google.comIs there any way to do this?Which application ?Yes, there is a way to do this.GreetzGreenhorn
James Posted May 9, 2008 Posted May 9, 2008 You could store the command in an ini file and then use the Execute() command to run it. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
ProgAndy Posted May 9, 2008 Posted May 9, 2008 I think, he wants to use the CMD commands $comm = "ping www.google.com" $PID = Run('"' & @ComSpec & '" /c ' & $comm,"",@SW_HIDE,2) $txt = "" While 1 $txt &= StdoutRead($PID) If @error Then ExitLoop WEnd $txt = OemToChar($txt) MsgBox(0, '', $txt) ;=============================================================================== ; Name: OemToChar ; Description: Wandelt einen ASCII- in einen ANSI-String ; Parameter(s): $szSrc = String der umgewandelt werden soll ; Requirement(s): keine ; Return Value(s): bei Erfolg: umgewandelter String ; bei Fehler: "" und @error = 1 ; Author(s): bernd670 ;=============================================================================== Func OemToChar($szSrc) ;~ Private Declare Function OemToChar Lib "user32.dll" Alias "OemToCharA" (ByVal lpszSrc As String, ByVal lpszDst As String) As Long Local $placeholder For $i = 0 To StringLen($szSrc) $placeholder &= " " Next Local $lRetVal = DllCall("user32.dll", "long", "OemToChar", "str", $szSrc, "str", $placeholder) If IsArray($lRetVal) And $lRetVal[0] = 1 Then Return SetError(0, 0, $lRetVal[2]) EndIf Return SetError(1, 0, "") EndFunc ;==>OemToChar *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
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