Command Executor - Path Concatentation with variables

Questions and answers on how to get the most out of FFAStrans
Post Reply
mr_paul
Posts: 2
Joined: Sat Aug 29, 2020 9:04 pm

Command Executor - Path Concatentation with variables

Post by mr_paul »

Hoping someone can assist me as I am new to FFAStrans I am trying to create a command for command executor to create a subfolder within a given directory based on filename.I have set the created the variable %s_deliverables_NIS% and set it's value to C:\.....\Desktop\Test_Output

Then created a Command Executor and added the following string:

%comspec% /C "mkdir "%s_deliverables_NIS%"Test"

I am attempting to create a subfolder within C:\.....\Desktop\Test_Output called "Test". Once I have done that I want to use the %s_original_name% variable so that the subfolder is called by the filename instead of "Test"

Example
123456.mp4 (Input)
Creates folder subfolder 123456 WITHIN C:\.....\Desktop\Test_Output

The workflow is failing and this is the relevant log section:
"split_id": "1-1-1",
"event": "run command",
"type": "error",
"data": {
"command": "C:\\WINDOWS\\system32\\cmd.exe \/C \"mkdir \"%s_deliverables_NIS%\"Test\"",
"code": 1,
"msg": "Process exited with error code: 1"
}

I know it is a problem with the syntax of the string I am passing to command executor and probably something to do with Windows path escaping.

Can anyone assist and perhaps provide a correct example of how I can achieve this.

Paul
momocampo
Posts: 595
Joined: Thu Jun 08, 2017 12:36 pm
Location: France-Paris

Re: Command Executor - Path Concatentation with variables

Post by momocampo »

Hi Paul,
Welcome to the forum and thanks to use FFAStrans ! ;)
If I understand well, you just want to create a folder into another folder with the name of your input file. This subfolder will be in a specific place : %s_deliverables_NIS% (C:\.....\Desktop\Test_Output)

No need to use your "test" folder if you want to replace it by something else after.
Ok so just change your command inside command executor :
%comspec% /C "mkdir "%s_deliverables_NIS%"Test" must be : %comspec% /C "mkdir "%s_deliverables_NIS%\%s_original_name%""

Be sure your folder "Test_Output"' exists and it should work .

Hope it helps.
Benjamin
mr_paul
Posts: 2
Joined: Sat Aug 29, 2020 9:04 pm

Re: Command Executor - Path Concatentation with variables

Post by mr_paul »

Hi Benjamin

Thanks for the welcome and reply!
Your understanding of my objective is perfect. So is the help you have provided!

Paul
Post Reply