I have been trying for about 3 days now trying to find a way to open multiple instances of a simple program and have had no luck. It is being used to log into a site multiple times and the web browser component uses the same cookie which is stopping me from just remaking the program a bunch of times in tabs. I then tried to make it so that it would open up the compiled program multiple times and be able to dock them, but am not able to do that.

What I am looking to do is have a text box that the user chooses a number between 1 and 6 and upon clicking a button inside a tab, that amount of the programs are opened inside of the tab. Preferably I would like to be able to move all of them and upon click a check box all of them are locked in place.


Any help with this would be awesome.

Recommended Answers

All 3 Replies

If you're talking about opening multiple instances with the debugger you can right click on the project in your solution explorer and select "Debug -- Start New Instance" and repeat the operation until you have the desired number of instances open.

If you're talking about at runtime you can do this:

Public Class frmSpawn

	Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
		Dim appCnt As Integer
		If (Integer.TryParse(TextBox1.Text, appCnt)) Then

			Dim i1 As Integer
			For i1 = 1 To appCnt
				System.Diagnostics.Process.Start(Application.ExecutablePath)
			Next i1

		End If
	End Sub
End Class

You probably don't want to copy the .EXE because often times there are configuration files and required assemblies located in the same directory. And you can't rely on the fact the user will have adequate permission to create a new file in the C:\Program Files\ directory because of virtualization in Vista.

Thank you so much, been trying to get help like this for awhile now and no one has even replied back giving me hints. I am pretty new to VB, was pretty much forced into it at school but the teacher never taught us anything while expecting us to just know.

Anyways, with this I should be able to do what I want. Thanks again.

You're welcome.

Please mark this thread as solved if you have found and answer to your question and good luck!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.