0

I am using MS Visual Studio 2010 to run an application. The application is being run from the project for various reasons. At one point I need to restart the program as it is done exactly by this button enter image description here.

I searched around for batch file code but I found none to undertake this task also tried the Application.restart but no luck so far. Can you help me?

Zac
  • 1,305
  • 3
  • 17
  • 28
Anna Marie Rapa
  • 119
  • 1
  • 3
  • 13
  • Why doesn't `Application.Restart()` work for you? – Visual Vincent Oct 31 '17 at 09:09
  • because it created multiple instances in process and crushes all the server. as this is done 100s of times everday – Anna Marie Rapa Oct 31 '17 at 09:16
  • Then you must have put it in a bad place, causing it to execute several times before the application exits. What happens if you create a shared boolean variable that you set to `True` once you've called `Restart()`, then check that before restarting, i.e: `If RestartInitiated = False Then Application.Restart() : RestartInitiated = True`? – Visual Vincent Oct 31 '17 at 09:20

0 Answers0