How to run a CMD command on instance startup ? (Windows VM)

Skip to first unread message

Yann Scheers

May 18, 2022, 12:31:22 PM5/18/22
to gce-discussion


I would like that every time I start my VM instance (in a scheduled period, daily), a Python script present in a specific folder is launched without me needing to connect from the Microsoft remote desktop (I'm on mac) to the VM.

The command is something simple like :

python "MyFilePath/"

I already have Python3 and the necessary modules to launch the script installed on my VM.

Is this possible?

Thanks a lot for your help.

Dasalem Clemente

May 19, 2022, 1:51:26 PM5/19/22
to gce-discussion

In this page you can find the options in GCP to use startup script in VMs using Windows and Linux.

A startup script is a file that contains commands that run when a virtual machine (VM) instance boots. Compute Engine provides support for running startup scripts on Linux VMs and Windows VMs.

Reply all
Reply to author
0 new messages