Windows file system - path whit variable

  • 788 Views
  • Last Post 14 June 2019
Rosario Tumello posted this 19 November 2018

Hello,

i have the input folder whit AAA and BBB subfolder, i would that scanshare deposit the processed file in the output subfolder that have the same name of the input subfolder. for example

C:\input\AAA (input file)

C:\output\AAA (output file)

i tried to insert the following trigger script on the connector to WFS, but the result  was to obtain the processed file on the path c:\output\%SubFolders%.

 

Can you help me?On Error Resume next

StartingFolder=Metadata.Values("%ORIGINALFILENAMEWITHPATH%")

Set fso = CreateObject("Scripting.FileSystemObject") 

Set Folder = fso.GetFolder(StartingFolder) 

Set SubFolders = Folder.SubFolders 

Order By: Standard | Newest | Votes
luigi.zurolo posted this 21 November 2018

Ciao Rosario,

starting from v4.9.0 there is a specific variable containing the subfolder checked by the watch folder module, especially designed for this specific job without using any custom script.

The variable is called WATCHFOLDERSUBPATH and you can find it in the variables list of the 4.9.0 and above manual, appendix section.

Rosario Tumello posted this 22 November 2018

Thanks for support, i'haven't the 4.9.0 version, I solved the problem whit this trigger script:

 

On Error Resume next

StartingFolder=Metadata.Values("ORIGINALFILENAMEWITHPATHWITHOUTEXTENSION")

TEMP = "e:\output\" & MID(StartingFolder,10,8)

call Metadata.SetValues("PROVA1", TEMP)

 

  • Liked by
  • luca.scarpati
  • luigi.zurolo
Steph posted this 14 June 2019

Hello Luigi,

I use  v4.10.0u38 64bit, and i can't find this variable WATCHFOLDERSUBPATH in Windows file connector. In watchfolder module i've checked "check subfolders".

Is there specific conditions to have this variable?

 

Edit: We find that the variable is not dsiplayed in variable list, but must be manually typed.

luigi.zurolo posted this 14 June 2019

Hello Steph,

 

no special condition since it has been included in 4.10u38, however you are right that it is not visible in the list and you need to write it manually.

This is by design for now because the variable has been inserted in a patch update, however will be part of the list just like other variables for the next version.

Close