Student_coder Posted June 6, 2016 Share Posted June 6, 2016 I am planning to embed cmd to my GUI. This is the function am using. Func _getDOSOutput($command) Local $text = '', $Pid = Run(@ComSpec & ' /c ' & $command, '', @SW_HIDE, 2 + 4) While 1 $text &= StdoutRead($Pid) If @error Then ExitLoop WEnd GUICtrlSetData($Output,$text) EndFunc;==>_getDOSOutput To the variable "$command" am passing the commands. The problem is that if we ping to a particular ip address it's not pinging. But if we just type ping it's replying. Can anyone points me in the right direction ?? Link to comment Share on other sites More sharing options...
Student_coder Posted June 6, 2016 Author Share Posted June 6, 2016 No one is there. Link to comment Share on other sites More sharing options...
Student_coder Posted June 6, 2016 Author Share Posted June 6, 2016 I have 3 tabs in a GUI. I tried to embed command prompt in one of the tabs but I was not able to do it. Can anyone suggest me a good option?? Link to comment Share on other sites More sharing options...
Student_coder Posted June 6, 2016 Author Share Posted June 6, 2016 Am stuck in between this script. Please let me know if there is any way to it. Link to comment Share on other sites More sharing options...
Developers Jos Posted June 6, 2016 Developers Share Posted June 6, 2016 (edited) Where do I start..... Posting in the wrong forum. Bumping within 24 minutes ( seriously??) Multiple topic creation on the same subject. so: start with reading the the forum rules before continuing posting in these forums and .. be patient! Jos Edited June 6, 2016 by 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...
Bowmore Posted June 6, 2016 Share Posted June 6, 2016 (edited) Your function works for me. The slightly modified version below displays the result of the ping command in the message box. Perhaps the problem is with the line GUICtrlSetData($Output,$text) but as I don;t have your GUI code I was unable to test that. _getDOSOutput("Ping 204.79.197.200") _getDOSOutput("Ping www.bing.com") _getDOSOutput("Ping 192.168.1.72"); <===== Change this for something on your own network Func _getDOSOutput($command) Local $text = '', $Pid = Run(@ComSpec & ' /c ' & $command, '', @SW_HIDE, 2 + 4) While 1 $text &= StdoutRead($Pid) If @error Then ExitLoop WEnd ;GUICtrlSetData($Output,$text) MsgBox(0,"Ping Test",$text) ;<==== Just for testing EndFunc;==>_getDOSOutput Edited June 6, 2016 by Bowmore "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook 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