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

413 views
Skip to first unread message

Yann Scheers

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

Hello,

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/filename.py"

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

unread,
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
Forward
0 new messages