# Cmd / Exec issue with arguments

**URL:** <https://discuss.gradle.org/t/cmd-exec-issue-with-arguments/18910>\
**Category:** Help/Discuss\
**Created:** [August 11, 2016, 9:09pm UTC](https://discuss.gradle.org/t/cmd-exec-issue-with-arguments/18910 "2016-08-11T21:09:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![akhileshthipparthi](https://avatars.discourse-cdn.com/v4/letter/a/bb73d2/32.png) [@akhileshthipparthi](https://discuss.gradle.org/u/akhileshthipparthi)\
**Post date:** [August 11, 2016, 9:09pm UTC](https://discuss.gradle.org/t/cmd-exec-issue-with-arguments/18910/1 "2016-08-11T21:09:52Z")

</div>

Hi,

I am trying to execute below command or execuatable in a task , but of them fail with a status code of 1 or -1 . Where as they work fine if i directly execute the same command using cmd prompt. Can you please help if syntax issues or antying ?

commandLine ‘cmd’,’/c’,’“C:\Program Files\IBM\WMBT700\mqsicreatebar.exe” -data ./OPV\_PUBLISH -b OPV\_PUB-SUB.bar -o MFP\_ProviderInitiateChangeEvent\MF\_ProviderInitiateChangeEvent.msgflow MSP\_InitiateChangeEvent\MS\_InitiateChangeEvent\messageSet.mset -trace ';

executable = '“C:\Program Files\IBM\WMBT700\mqsicreatebar.exe”'  
args = ["-data", “$builddir”, “-b”, barFileName, “-o $files\_path”, “-trace”]

Thanks  
Akhilesh
