execCommand() is not working in workflow. | Community
Skip to main content
parveshp7822672
Level 3
Nov 4, 2019 9:44 AM UTC
Solved

execCommand() is not working in workflow.

Hello Everyone,

execCommand() is not working in a JS activity in a workflow on application server.

There is on-premise instance and build is 9032.

Configuration is serverConfig.xml:

<!-- Command execution

         blacklistFile :  Path to the file containing the commands to blacklist

         user :  Execute commands as a different user -->

    <exec blacklistFile="" user=""/>

JS Code:

logInfo(execCommand("cd",true));

Error:

BAS-010076 Cannot execute command 'cd' (err=2, the system cannot find the file specified.).

I am getting same error for every commands.

Please let me know if you have any question.

Thanks.

Parvesh.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
saikatk2447661
saikatk2447661Accepted solution
Level 4
Nov 4, 2019 10:04 AM UTC

If this is windows server try logInfo(execCommand("cmd /c cd",true));

6 replies

parveshp7822672
Level 3
Nov 4, 2019 6:02 PM UTC

Hello Jon,

Yes, 'cd' is a cmd command.

Can you please explain, what do you mean by Windows executable?

Thanks.

Parvesh.

Translate
Jonathon_wodnicki
New Participant
Nov 4, 2019 5:49 PM UTC

Hi,

'cd' is not a Windows executable, it's a cmd command.

Thanks,

-Jon

Translate
saikatk2447661
Level 4
Nov 4, 2019 10:32 AM UTC

1. No idea.

2. Adhiyan​​ told me few months back.

Translate
parveshp7822672
Level 3
Nov 4, 2019 10:08 AM UTC

Hello Saikatk,

Thanks it is working now.

Could you please explain me why the first one was not working?

This solution is not mentioned in documentation.

How did you find it?

Thank.

Parvesh.

Translate
saikatk2447661
saikatk2447661Accepted solution
Level 4
Nov 4, 2019 10:04 AM UTC

If this is windows server try logInfo(execCommand("cmd /c cd",true));

Translate
Level 2
Jan 27, 2020 4:26 PM UTC
Hi, I have windows location as D:/Adobe/Adobe Campaign v6/var/ALGN/workflow under that i have directories starts with "wf-algn__" and again inside, one more directory is there "Workflow". Finally i have files with .TXT and .CSV , I want to remove all those files. need some suggestion on how to achieve that. Regards, Rajshekar.
Translate