Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Loop and call of CMD with network drive, any smarter way?

Hello, I have quite weird case, which is causing some problems on my environment.

Let's say I have some network drive, mapped to  X:\  on that I have application in following structure:

X:\PROJECT\QVD_generator.qvw

X:\PROJECT\QVD\ *  ( directory with files )

X:\OTHER_PROJECT\QVD\*  ( directory with files )

Inside generator I have relative paths :

let qvd=".\qvd\";

let qvd_other_project = "..\OTHER_PROJECT\qvd\";

the problem is that I want to copy all files generated within qvd directory to "other project" . One of developer which wrote script decided to call  :

STORE $(qvd)FILE.QVD

STORE $(qvd_other_project)FILE.QVD

The problem is that this type of behavior is repeated 3 x per file and depends form environment. I believe it's not the best practice that's why I want to use some post process to copy all fles from $qvd into $qvd_other_project and here is the problem

I'm using command

EXECUTE cmd.exe /C copy  <file> <file>

what makes sense only when I use full paths, because due to network drive possibility of using relative paths seems to be limited.

so call above will not work :

EXECUTE cmd.exe /C copy  .\QVD\FILE.QVD ..\OTHER_PROJECT\QVD\FILE.QVD 

but call works fine

EXECUTE cmd.exe /C copy  X:\QVD\FILE.QVD X:\OTHER_PROJECT\QVD\FILE.QVD

I'm able to finish this task but it's really far away from something what can be done with any other standard programming language.


for each file in FileList(' <someqvdmask >' )

                          // file now has full path

            LET fileName = Subfield( '$file' .....

            LET dir =  concatenation of  $file's path with $qvd_other_project

           

            EXECUTE cmd.exe /C  $(file)  $(dir)$(fileName)

next file

What is painful, I'm unable to use all functions which are working on paths, because they can be used only with LOAD statement.

0 Replies