alright i got a bit further now after adding the sh.exe to the same location from where im running packer.
now im getting the below, doesn't seem to matter what script i run but here is the result:
2017/07/19 09:04:46 packer.exe: 2017/07/19 09:04:44 starting local command: cmd.exe /c scripts/copy.cmd
2017/07/19 09:04:46 [INFO] (telemetry) ending shell-local
2017/07/19 09:04:46 [INFO] (telemetry) found error: Erroneous exit code 3221225781 while executing script: scripts/copy.cmd
Please see output above for more information.
2017/07/19 09:04:46 Deleting original artifact for build 'null'
2017/07/19 09:04:46 ui error: Build 'null' errored: 1 error(s) occurred:
* Post-processor failed: Erroneous exit code 3221225781 while executing script: scripts/copy.cmd
2017/07/19 09:04:46 Builds completed. Waiting on interrupt barrier...
2017/07/19 09:04:46 machine readable: error-count []string{"1"}
2017/07/19 09:04:46 ui error:
==> Some builds didn't complete successfully and had errors:
2017/07/19 09:04:46 machine readable: null,error []string{"1 error(s) occurred:\n\n* Post-processor failed: Erroneous exit code 3221225781 while executing script: scripts/copy.cmd\n\nPlease see output above for more information."}
2017/07/19 09:04:46 ui error: --> null: 1 error(s) occurred:
* Post-processor failed: Erroneous exit code 3221225781 while executing script: scripts/copy.cmd
Please see output above for more information.
2017/07/19 09:04:46 ui:
It is just a simple .CMD command to copy a file, when i run in CMD it works fine as below.
C:\PACKER\OPTUSgit\scripts>copy.cmd
C:\PACKER\OPTUSgit\scripts>cmd.exe /c copy c:\tools\winscp.ini c:\temp
1 file(s) copied.
Below is my test template, just encase i am doing something wrong but i doubt it:
{
"builders":[{
"type": "null",
"communicator":"winrm",
"winrm_host": "10.1.1.10",
"winrm_username":"jimmy",
"winrm_password":"password",
"winrm_port":"5985",
"winrm_timeout":"24h"
}],
"provisioners": [
{
"type": "windows-shell",
"inline": "shutdown /s /t 1 /f /d p:4:1 /c \"Packer Shutdown Stage 1\""
}
],
"post-processors":[
{
"type":"shell-local",