raclius Posted May 31, 2006 Share Posted May 31, 2006 Hello, How execute two command at the same time ? Thanks (sorry for my english) Link to comment Share on other sites More sharing options...
Valuater Posted May 31, 2006 Share Posted May 31, 2006 welcome to the forums... like what type of commands Run("Notepad.exe", "", @SW_MAXIMIZE) Run("Notepad.exe", "", @SW_MAXIMIZE) this will run notepad twice.... very rapidly as if 2 at a time 8) Link to comment Share on other sites More sharing options...
raclius Posted May 31, 2006 Author Share Posted May 31, 2006 welcome to the forums... like what type of commands Run("Notepad.exe", "", @SW_MAXIMIZE) Run("Notepad.exe", "", @SW_MAXIMIZE) this will run notepad twice.... very rapidly as if 2 at a time 8) I would like : Run("Notepad.exe", "", @SW_MAXIMIZE) and Run("Notepad.exe", "", @SW_MAXIMIZE) on the same line :"> Link to comment Share on other sites More sharing options...
Valuater Posted May 31, 2006 Share Posted May 31, 2006 i think what i showed you is as fast and as representative as you cant get... for what you want 8) Link to comment Share on other sites More sharing options...
raclius Posted May 31, 2006 Author Share Posted May 31, 2006 i think what i showed you is as fast and as representative as you cant get... for what you want 8) Sample : For $x = 1 to $array[0] RunWait ( @ComSpec & " /c program1 " & $array[$x] , "", @SW_HIDE ) RunWait ( @ComSpec & " /c program2 " & $array[$x] , "", @SW_HIDE ) Next $array can go to 1000 values, thus y would like to save time in run process at the same time Link to comment Share on other sites More sharing options...
Valuater Posted May 31, 2006 Share Posted May 31, 2006 for only 3 posts you seem very sharp in what you want... however runwait will stop your script as wriiten above also Sample : For $x = 1 to $array[0] Run ( @ComSpec & " " & $array[$x] , "", @SW_HIDE ) Next will run those 1000 programs very very fast .......... i dont think i like your direction, if you are going to run 1000 programs all hidden... you are going to have problems or malware? 8) Link to comment Share on other sites More sharing options...
mr.underperson Posted May 31, 2006 Share Posted May 31, 2006 Sound like a virus. -mu Link to comment Share on other sites More sharing options...
raclius Posted May 31, 2006 Author Share Posted May 31, 2006 for only 3 posts you seem very sharp in what you want... however runwait will stop your script as wriiten above also Sample : For $x = 1 to $array[0] Run ( @ComSpec & " " & $array[$x] , "", @SW_HIDE ) Next will run those 1000 programs very very fast .......... i dont think i like your direction, if you are going to run 1000 programs all hidden... you are going to have problems or malware? 8) lol no malware, just requests SNMP RunWait ( @ComSpec & " /c snmpwalk -v 1 -Oqn -c " & $community & "@" & $Vlan[$x] ......... I want to make a portmapper for cisco equipment, who comprises X vlan Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 31, 2006 Moderators Share Posted May 31, 2006 (edited) I have been looking at this, and was going to offer a VMultiThread option, but I don't see the difference inFor $x = 1 to $array[0] RunWait ( @ComSpec & " /c program1 " & $array[$x] , "", @SW_HIDE ) RunWait ( @ComSpec & " /c program2 " & $array[$x] , "", @SW_HIDE ) Nextor if this even workedRunWait ( @ComSpec & " /c program1 " & $array[1] , "", @SW_HIDE ) And RunWait ( @ComSpec & " /c program2 " & $array[2] , "", @SW_HIDE )Considering that you would still need to wait until the 1st one is ran for the 2nd one to run in either case. Are you just wanting to run multiple applications/launches at the same time? I tested a VMultithread option and it worked, but RunWait seems kind of senseless in that case, because you don't want to "wait". Sorry, I might be misunderstanding you exact scenerio you "need/want" to happen. Edited May 31, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
raclius Posted May 31, 2006 Author Share Posted May 31, 2006 (edited) I have been looking at this, and was going to offer a VMultiThread option, but I don't see the difference inFor $x = 1 to $array[0] RunWait ( @ComSpec & " /c program1 " & $array[$x] , "", @SW_HIDE ) RunWait ( @ComSpec & " /c program2 " & $array[$x] , "", @SW_HIDE ) Nextor if this even workedRunWait ( @ComSpec & " /c program1 " & $array[1] , "", @SW_HIDE ) And RunWait ( @ComSpec & " /c program2 " & $array[2] , "", @SW_HIDE )Considering that you would still need to wait until the 1st one is ran for the 2nd one to run in either case. Are you just wanting to run multiple applications/launches at the same time? I tested a VMultithread option and it worked, but RunWait seems kind of senseless in that case, because you don't want to "wait". Sorry, I might be misunderstanding you exact scenerio you "need/want" to happen. I use runwait bus I write the result in a file : For $x = 1 to $array[0] ; array 1 ~ 400 RunWait ( @ComSpec & " /c program1 field" & $array[$x] & " >> file1.txt", "", @SW_HIDE ) RunWait ( @ComSpec & " /c program2 field" & $array[$x] & " >> file2.txt", "", @SW_HIDE ) I seek to launch plusior command in simultaneous If you have another solution I am taking :"> not obvious A to explain, therefore has to help Edited May 31, 2006 by raclius Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 31, 2006 Moderators Share Posted May 31, 2006 I'm still confused, but that's normal for me, I live in a state of confusion. See if this helps any$URL = 'http://www.autoitscript.com/donate.php' _RunWaitExLine(@ComSpec & " /c Start " & $URL, '', @SW_HIDE) Func _RunWaitExLine($sRunString, $vWorkingDir = @WorkingDir, $vFlag = @SW_SHOW) $iExecPID = Run(@AutoItExe & ' /AutoIt3ExecuteLine ' & _ '"RunWait(' & "'" & $sRunString & "'," & "'" & $vWorkingDir & "'," & "'" & $vFlag & "')" & '"') Return $iExecPID ; Returns new launched PID EndFuncWarning... This will launch a new app/exe for each instance it is called. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Valuater Posted May 31, 2006 Share Posted May 31, 2006 probably better than my idea ******* not tested ; Maybe.... compile this as RunMan.exe If $CMDLine[0] > 0 Then RunWait ( @ComSpec & " /c program1 field" & $CMDLine[1] & " >> " & $CMDLine[2], "", @SW_HIDE ) EndIf ; then in your script $Runman = @TempDir & "\TempRun.exe" FileInstall("C:\Program Files\AutoIt3\RunMan.exe", $Runman) For $x = 1 to $array[0]; array 1 ~ 400 Run($Runman & ' "' & $array[$x] & '" "' & "file1.txt" & '"') Run($Runman & ' "' & $array[$x] & '" "' & "file2.txt" & '"') ; wait for the 2 processes to close While 1 If Not ProcessExists("RunMan.exe") Then ExitLoop Sleep(20) WEnd Next 8) Link to comment Share on other sites More sharing options...
raclius Posted May 31, 2006 Author Share Posted May 31, 2006 thank you for your ideas, I will test all that Link to comment Share on other sites More sharing options...
w0uter Posted May 31, 2006 Share Posted May 31, 2006 (edited) While 1 If Not ProcessExists("RunMan.exe") Then ExitLoop Sleep(20) WEndoÝ÷ Ú,(ºW]¢+eGºÚ"µÍÚ[HØÙÜÑ^ÝÊ ][ÝÔ[Ý^I][ÝÊHÔØÙÜÑ^ÝÊ ][ÝÔ[^I][ÝÊHÛY BÑ[ Edited May 31, 2006 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll 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