Reputation: 117
I have a client-server application, in client-side windows application GNS3. In server-side GNS 3 server running on google cloud instance. I'm looking for a way to start automatically instance when I start the windows application
Upvotes: 0
Views: 102
Reputation: 81336
Unless you can modify your program to execute an external program, the only idea I have is to create a batch file that can start your instance and then launch your Windows application.
In the batch file or powershell script, add a command to start the Google Compute VM instance: gcloud compute instances start
Then add another line to the batch file with the full path to your program: "C:\Program Files\companyX\MyProgram.exe"
You can then create a link to this batch file on your desktop to support double-clicking to launch the batch file.
You might want to add a delay between starting the instance and your program if you need the instance to be up and running before your program.
Automatically stopping the instance will be difficult as Windows runs everything asynchronously. You would need to write a monitor to catch when the Windows application terminates.
Upvotes: 2