Hi,
make sure to escape the path if it has spaces:
bat('start “C:/Users/User/.jenkins/workspace/Project/Steam Build 
Scripts/scripts/build_dev.bat”');

Why do you need the start? Is the command return before completion or something?


From: jenkinsci-users@googlegroups.com <jenkinsci-users@googlegroups.com> On 
Behalf Of jesus fernandez
Sent: September 24, 2020 8:24 AM
To: Jenkins Users <jenkinsci-users@googlegroups.com>
Subject: how to execute a bash script in a jenkins declarative pipeline

I have started recently using Jenkins in windows 10. I have a freestyle job 
that sync from the SCM, build a C++ solution and then it runs a batch script to 
upload to steam. I am trying to convert it to pipeline as I realized reading 
the documentation how much more powerful it is. My problem is that on the step 
to run the .bat file it gets stuck forever, this is the step:
```
...
Stage('batch script'){
            steps{
                bat 'start C:/Users/User/.jenkins/workspace/Project/Steam Build
                Scripts/scripts/build_dev.bat'
            }
        }
...
```

and this is the simple .bat file:
```
"C:\Users\User\.jenkins\workspace\Project\Steam Build 
Scripts\builder\steamcmd.exe" +login "someUser" "somePassword" +run_app_build 
"C:\Users\User\.jenkins\workspace\Project\Steam Build 
Scripts\scripts\app-build-813780-dev.vdf" +quit

```

running the same file from the freestyle job works fine like 
this:[cid:image001.png@01D6925A.705FD950]
--
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
jenkinsci-users+unsubscr...@googlegroups.com<mailto:jenkinsci-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/e9a2b099-812c-4cb3-a459-0000f874e455n%40googlegroups.com<https://groups.google.com/d/msgid/jenkinsci-users/e9a2b099-812c-4cb3-a459-0000f874e455n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/QB1PR01MB38447B0DED7787FED6E8BFA3CD390%40QB1PR01MB3844.CANPRD01.PROD.OUTLOOK.COM.

Reply via email to