Script task unable to run file in Windows

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Symptoms

If Bamboo starts as a Windows Service and a script task tries to execute a file, it may fail with the following message:

1 2 3 simple 10-Aug-2012 14:55:41 Starting task 'test' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.command' command 10-Aug-2012 14:55:41 Beginning to execute external process for build 'ABC-DEF-GH - Test - Default Job'<br /> ... running command line: <br />c:\windows\system32\cmd.exe<br /> /c<br /> c:\path\to\my\test.exe<br /> ApplyChanges<br /> EnableRecon<br /> 0<br /> ... in: C:\bamboo-home\xml-data\build-dir\131073\DEF-GH-JOB1<br /> ... using extra environment variables: <br />bamboo_IW_ASSETDB_USER=fkraemer<br /> build 10-Aug-2012 14:55:42 Command not found ApplyChanges ( EnableRecon, 0 )

The message may not be the same as the above.

Cause

This is generally caused by permissions problems. When Bamboo is started manually, the user that started it has permissions to run the .bat file, but when Bamboo starts as a Windows service, no user is configured or the user configured in the Bamboo service does not have enough permissions to do the same, or this user configured in the service is not a local user, but a Windows domain user.

This also might be related to the file not being bundled the way to be used with a service.

Resolution

Try to stop the Bamboo service (Start Menu >> Run... > services.msc), start Bamboo manually (BAMBOO_INSTALL/BambooConsole.bat), and try to run the plan again to see if the problem is indeed related to permissions.

If the plan is built successfully, then please go to Bamboo service >> 'Properties' menu >> 'Log On' tab and check if the account configured there has permission to run the file. Please make sure the service is not using the USERNAME or SYSADMIN variable. It should be a real username.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.