Jump to content

Loop and Incremente number in .exe


Recommended Posts

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
Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...