Skip to main content
Question

SystemCaller with xcopy /I /E /Y /T doesn´t create a directory

  • Mar 7, 2024 1:39 PM UTC
  • 6 replies
  • 222 views

gjaguilar
Contributor
Forum|alt.badge.img+6

xcopy "$(TEMP_FOLDER)\$(FME_JOB_ID)\Temp"  "$(TEMP_FOLDER)\$(FME_JOB_ID)\Results" /I /E /Y /T

From the command line I use xcopy /I /E /Y /T and if the directory does not exist it creates it but within a SystemCaller it does not work and does not give an error message.

I need Help 

6 replies

becchr
Influencer
Forum|alt.badge.img+35
  • Influencer
  • Mar 7, 2024 3:15 PM UTC

hi @gjaguilar does it make any difference if you put the entire command itself between extra quotation marks like this?

“xcopy "$(TEMP_FOLDER)\$(FME_JOB_ID)\Temp"  "$(TEMP_FOLDER)\$(FME_JOB_ID)\Results" /I /E /Y /T”


gjaguilar
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • Mar 7, 2024 3:21 PM UTC

Thanks, I´ll try 


gjaguilar
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • Mar 7, 2024 5:20 PM UTC

It does not work
I enclosed in double quotes and it doesn't work
the process stops to ask if it is a file or a directory
Locally using /I /E /Y does it fine


geomancer
Evangelist
Forum|alt.badge.img+69
  • Evangelist
  • Mar 8, 2024 8:41 AM UTC

Ah yes, quotes inside quotes. This works (with and without spaces in the folder names):

"xcopy """@Value(FilePath)""" """@Value(TargetFolder)\Results""" /I /E /Y /T"


gjaguilar
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • Mar 8, 2024 8:46 AM UTC

Thanks, I´ll try  again 


gjaguilar
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • Mar 13, 2024 9:22 AM UTC

 I added a FileExistenceChecker transformer to check if the directory exists before using xcopy; otherwise I use another SystemCaller to create a directory with mkdir.

Thanks a lot