Jenkin Job Setup Question

I have 2 windows nodes and have to run different set of commands in these nodes. I am using master/slave concept to connect to the remote VM via Jenkins.
In the single job , how can I do that?

VM#1 :-
cd c:\temp1
rm -f *.log

VM#2 :
cd c:\temp2
rm -f *.temp

Version :- Jenkins 2.339

Hi there,

As a reminder, the term “slave” to refer to an agent has been deprecated since 2016. Please refer to On Jenkins Terminology Updates for more details. We request you update your post.

Gavin Mogan

pipeline {
  agent none
  stages {
    stage('VM#1') {
      agent { label: 'Vm1' }
      steps {
        bat("deltree /y c:\temp1\*.log") # or something, i'm not a windows power user
    stage('VM#2') {
      agent { label: 'Vm2' }
      steps {
        bat("deltree /y c:\temp2\*.log") # or something, i'm not a windows power user