Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello programmers!!
In my application I am doing simulation from previously logged data. Logged data files are in one folder e.g Folder_A. Now I want to start as much instance of application as much files are in the Folder_A.
Previous i was passing single file to application for singel simulation. Was easy but now start as much instance of application as many files are in Folder-A. Each instance execute one of the file.
e.g. Applicaion "myapplication" need to simulate fileA and FileB at same time with two different instances.
Any help or suggestion would be appreciated.
Thanks

What I have tried:

previously i was doing with single file. it was easy one file one instance.
Posted
Updated 28-Jul-16 23:08pm
v2

1 solution

Just write a command / batch file that does the job:
rem Start application for each file in specific directory
echo off
for %%i in (data_file_path\*) do app_path_and_name "%%i"

Here data_file_path is the full path to your data files and app_path_and_name is the full path and name of your application. Note that these must be enclosed by double quotes when they contain spaces.

To test what would be done just insert an echo command after do:
rem Start application for each file in specific directory
echo off
for %%i in (data_file_path\*) do echo app_path_and_name "%%i"


[EDIT]
To know about the FOR command, open a command prompt window and type
help for

[/EDIT]
 
Share this answer
 
v2
Comments
XamBEE 29-Jul-16 5:04am    
I did not get you solution unfortunately because I dont know much about batch file. Would be nice if you elaborate it bit more.
I also rephrased my question..
Jochen Arndt 29-Jul-16 5:38am    
Open a text editor, copy the code, and paste it.
Then save to a file using the extension .bat or .cmd.
Finally execute the file by double clicking on it from within the Windows Explorer.

If you want to see what happens, open a command prompt window, and execute the saved file (navigate to the folder where it has been saved or enter the complete path).

I will update my answer with some explanations.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900