# Path Attribute File to Exec Command - Windows Agent bat file

I am trying to create a .bat file to run on my Windows Agents. The batch file is generated in a File type by a template, and then executed by the Exec type. Here is the code:

define nexus::version () {
file { "create-bat":
path => "$WHAT_GOES_HERE/modules/nexus/files/nexus_java_exec.bat", content => template("/home/puppet/modules/nexus/templates/nexus_java.conf.erb"); } exec { "execute_bat": command => "$WHAT_GOES_HERE/modules/nexus/files/nexus_java_exec.bat",
path      => 'C:/Program Files/Java/jdk1.6.0_20/bin',
}
}

Running locally in Windows, I can simply use the local path, and everything works:

$WHAT_GOES_HERE = 'C:/ProgramData/PuppetLabs/etc/puppet' However, since i ... edit retag close merge delete ## 1 answer Sort by » oldest newest most voted OK, I just wasted some time here... The answer is of course option 1.$WHAT_GOES_HERE = 'C:/ProgramData/PuppetLabs/etc/puppet'

I didn't have the path properly setup, so the puppettmp_6166 extension was Puppet telling me the parent directory didn't exist. The poor error messaging is already logged:

Known issue with Pupper Issue 1763

more