Skip to main content
Question

SystemCaller failing to run command that works through CMD.


michaelfrance
Contributor
Forum|alt.badge.img+1

Hi,

I have hundreds of word documents that i am trying to extract the text from in order to run analysis on the content. I have tried just using the MS word reader to open a .docx file but with not success so have seeked alternative workarounds to achieve this.

One of the common solutions I have come across is running a command for 7-Zip  in the system caller to extract to word document into XML then load XML.

My issue is that, although the command runs fine when run directly in CMD, when run through the system caller it requires a response regarding duplicate files. 

“Would you like to replace the existing file:
  Path:     .\[Content_Types].xml
  Size:     3893 bytes (4 KiB)
  Modified: 1980-01-01 00:00:00
with the file from archive:
  Path:     [Content_Types].xml
  Size:     3893 bytes (4 KiB)
  Modified: 1980-01-01 00:00:00
? (Y)es / (N)o / (A)lways / (S)kip all / A(u)to rename all / (Q)uit?“

As mentioned the command prompt works fine in CMD but not through system caller. 

The Command used is ““(7-zip.exe file path)” x “(.docx file path)” -o”(output folder path)””

Both the ‘.docx file path’ and ‘output folder path’ are set with attributes. so no two docx should have the same output. 

Any ideas what may be causing this and how I can resolve the issue.

Thanks for the help in advance.

5 replies

alexbiz
Enthusiast
Forum|alt.badge.img+14
  • Enthusiast
  • June 17, 2025

You could add -y -aoa to your command. That would assume yes on all queries and overwrite all files.
““(7-zip.exe file path)” x “(.docx file path)” -y -aoa -o”(output folder path)””

Or else :
-aoa : overwrite all
-aos : skip existing files
-aou : auto-rename extracted file
-aot : auto-rename existing file


alexbiz
Enthusiast
Forum|alt.badge.img+14
  • Enthusiast
  • June 17, 2025

Also, the BetterSystemCaller transformer might help here, if you’re trying to get the outputs of your command.


michaelfrance
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • June 18, 2025

Thanks Alexbiz. Unfortunately adding the overwrite command doesn't make a difference. I have tried both with the standard SystemCaller and BetterSystemCaller. the only difference is that the BetterSystemCaller runs though with a failed error code where SystemCaller just gets stuck. I have notice that it appears to be ignoring the output file path and writing it to the route folder of the FME workbench.


alexbiz
Enthusiast
Forum|alt.badge.img+14
  • Enthusiast
  • June 18, 2025

Could you share your exact command you’re trying to execute ?


michaelfrance
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • June 18, 2025

The command in system caller is;

""C:\Program Files\7-Zip\7z.exe" x "@Value(Input File Path)" -y -aoa -o"@Value(Output File Path)""

Thanks


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings