473,385 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Any idea about how can i create something like this?

I want to create an app that helps me to automate opening consecutive .exe files.

The general blueprint: Open the initial app -> Start -> Open .exe #1 -> Click next -> Close .exe #1 & Open .exe #2 [...]

Sorry, but I am a complete newbie.
Feb 20 '20 #1
2 2536
SioSio
272 256MB
This code is vb.net.
This code launches three applications(Notepad,cmd,mspaint) in sequence by pressing button 1.
It return to start when all three applications have been executed.
Expand|Select|Wrap|Line Numbers
  1.     Dim Program() As String = {"Notepad", "cmd", "mspaint"}    
  2.     Dim MaxProgram As Integer = Program.Length
  3.     Dim Counter As Integer
  4.     Dim hPros As System.Diagnostics.Process
  5.     Public Sub New()
  6.         Me.InitializeComponent()
  7.         button1.Text = "Start"
  8.         Counter = 0
  9.     End Sub
  10.  
  11.     Sub Button1Click(sender As Object, e As EventArgs)
  12.         If Counter = 0 then
  13.             'Exec App and Get Process Instance
  14.             hPros = System.Diagnostics.Process.Start(Program(Counter))
  15.             Counter = Counter + 1
  16.             button1.Text = "Next"
  17.         Else If Counter <= MaxProgram Then
  18.             'Find Execut process in all processes
  19.             Dim ps As System.Diagnostics.Process() = System.Diagnostics.Process.GetProcesses()                
  20.             For Each p As System.Diagnostics.Process In ps
  21.                 If p.id = hPros.Id Then
  22.                     'Kill Process
  23.                     hPros.Kill()
  24.                     Exit for
  25.                 End If
  26.             Next
  27.              'Close and Dispose
  28.             hPros.Close()
  29.             hPros.Dispose()
  30.             If Counter < MaxProgram Then
  31.                 hPros = System.Diagnostics.Process.Start(Program(Counter))
  32.                 Counter = Counter + 1
  33.                 button1.Text = "Next"
  34.             Elseif Counter = MaxProgram
  35.                 'Restart
  36.                 button1.Text = "Start"
  37.                 Counter = 0    
  38.             End If
  39.         End If        
  40.     End Sub
Feb 21 '20 #2
Process.Start("application1");
Process.Start("application2");
Process.Start("application3");
Feb 26 '20 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: ksharma | last post by:
#include <iostream> #include <map> using namespace std; class Base { public: ~Base() {} virtual void example() { cout <<"Base Example"<<endl;
8
by: windandwaves | last post by:
Hi Folk I want to create something like AMAZON: those who liked page A also liked page B (I am going to apply the concept to a few different selections, but to keep it simple I will talk about...
4
by: heming_g | last post by:
i directly copy the file compiled in another machine to sqllib/function , and run the createfun.sql but when i run it .. it throw sql0444n
59
by: MotoK | last post by:
Hi Experts, I've just joined this group and want to know something: Is there something similar to smart pointers in C or something to prevent memory leakages in C programs. Regards MotoK
5
by: Paul M | last post by:
Hi I need to create a map for a room (chairs, bed, TV, forniture, etc). All object allready exists like png images. I need to create a map for each room, i mean the user need to create. How...
3
by: m.smith_1999 | last post by:
Hello, I'm a student software developer. As a part of an excerise I'm doing I'm trying to build a program to create "mount files" and mount them. Something like Sarah Dean's OTFE but really...
4
by: dmeglio | last post by:
I was wondering if anyone knew of any resources that would help me build something akin to the VS.NET form designer? Meaning, say I have a Button object on my form. I want it to have that kind of...
1
by: satyasri adapa | last post by:
Warning: mail() : Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\smtp\smtp7.php on line 22 Cannot...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.