Sign in to follow this  
Followers 0
frankhack1

Loop and Incremente number in .exe

4 posts in this topic

#1 ·  Posted (edited)

Hi !

I have 50 Firefox.exe (different Profiles), each one of them with the name:

Firefox_01

Firefox_02

Firefox_03

Firefox_04

Firefox_05

etc... till Firefox_50

I'm trying to do a script that search If Firefox_30 process exists, if YES, then open next Firefox... in this case Firefox_31 is the next Firefox, but it may happen Firefox_31 is also open, so loop till it finds a Firefox process that is not open and open it. The count starts at Firefox_30 and ends at Firefox_50, I don't want to close any process, just jump it and try to open next Firefox that is not open yet.

I have then:

; This is the first Firefox to start Searching for (Firefox_30)
$start = 30
 

; This is the variable that will increase by one
$increment = 31 ; This is another question inside the question... is there any way to say $increment = $start += 1, I mean, whatever is inside $start, it will be one more in $increment, I tried "$increment = $start += 1" but didn't work.
 

; Search till (Firefox_50)
$end = 50
 
 
Do
If ProcessExists("Firefox_"&$start&".exe") Then
   Run("Firefox_"&$increment&".exe")
   Else
    Run("Firefox_"&$start&".exe")
 EndIf
 
; Variable $increment goes 1 more
   $increment+=1
 
; Loop till Firefox_50 and stop Loop
Until $increment == $end

This far, my code is just checking for FIrefox_30, and if process exist, then is opening all other firefox from 31 till 50 and that is not what I want, I just want only one Firefox to be opened... the one available

Edited by frankhack1

Share this post


Link to post
Share on other sites



Wow. Can you please tell us why you need to run up to 40 instances of FireFox?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hi, I just changed the message, is 50 instances, I use iMacros for posting advertisment on different sites, inside iMacros I use javascripts, I can't use 2 javascripts in one Firefox instance (in 2 separated windows but one Firefox) cause it will collapse, so I need to open each javascript macros in different Firefox instances. I bought for this a SSD computer and 16GB Ram in order to run more or less smooth and I use a customize light version of firefox.

Edited by frankhack1

Share this post


Link to post
Share on other sites

frankhack1,

 

is 50 instances, I use iMacros for posting advertisment on different sites

I regard this as spamming and so not something we wish to support - thread closed. :naughty:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0