Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Procedure.s ExecuteCmd(sCommand.s)
- cmdPath.s = Space(#MAX_PATH)
- GetSystemDirectory_(@cmdPath, #MAX_PATH)
- cmdPath + "\cmd.exe"
- sResult.s = ""
- If FileSize(cmdPath) > 0
- cmd = RunProgram(cmdPath,"/C " + sCommand, GetPathPart(cmdPath), #PB_Program_Open|#PB_Program_Read|#PB_Program_Hide)
- If cmd
- While ProgramRunning(cmd)
- If AvailableProgramOutput(cmd)
- sResult + ReadProgramString(cmd) + #CRLF$
- EndIf
- Wend
- EndIf
- Else
- sResult + "cmd Was not Found!!! ERROR!!!!"
- EndIf
- ProcedureReturn sResult
- EndProcedure
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement