

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
EXECUTE command to move files listed in an XLSX or TXT ?
Hi All,
I am in process of Moving and Coping some QVWs/QVDs from one Destination to other using an EXECUTE command in a QVW.
EXECUTE cmd.exe /C MOVE "SOURCE" "DESTINATION"
EXECUTE cmd.exe /C COPY "SOURCE" "DESTINATION".
Requirement -
Want to write the name of QVDs/QVWs in a single XLSX or TXT file, so that EXECUTE can read the file and MOVE and COPY all the entries in them. This would avoid writing the EXECUTE command multiple times for multiple files.
Any suggestions?
Regards!
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
so you want to do
EXECUTE cmd.exe /C COPY "SOURCE" "DESTINATION"
EXECUTE cmd.exe /C COPY "SOURCE1" "DESTINATION1"
to
EXECUTE cmd.exe /C xCOPY /Y /I "SOURCE" "DESTINATION" && "SOURCE1" "DESTINATION1"
1:
store all the source and destination in table and use EXECUTE cmd.exe /C COPY "SOURCE" "DESTINATION" inside a for loop
2:
store source and destination in a file and concatenate them in such a way that they form the part in bold and use a variable instead
EXECUTE cmd.exe /C xCOPY /Y /I "SOURCE" "DESTINATION" && "SOURCE1" "DESTINATION1"
regards
Pradosh


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could do the looping over set of filenames in a file in a WIndows batch file. Look here for an example:
scripting language - Copy a list (txt) of files - Stack Overflow
or here


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi jontydkpi
This is cool. Thanks for this.
I was thinking to that in EXECUTE so that I can Automate the Reload of the the QVW in QMC.
Anyways, if we are doing that in a BATCH file, need to automate that may be by Windows Task Scheduler or Powershell.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was thinking you would use EXECUTE to call the batch file from within the script...


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
so you want to do
EXECUTE cmd.exe /C COPY "SOURCE" "DESTINATION"
EXECUTE cmd.exe /C COPY "SOURCE1" "DESTINATION1"
to
EXECUTE cmd.exe /C xCOPY /Y /I "SOURCE" "DESTINATION" && "SOURCE1" "DESTINATION1"
1:
store all the source and destination in table and use EXECUTE cmd.exe /C COPY "SOURCE" "DESTINATION" inside a for loop
2:
store source and destination in a file and concatenate them in such a way that they form the part in bold and use a variable instead
EXECUTE cmd.exe /C xCOPY /Y /I "SOURCE" "DESTINATION" && "SOURCE1" "DESTINATION1"
regards
Pradosh


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks.
Your XCOPY Command and the Concatenation trick helped a lot. This is helping me achieving the results as well.
Also, I had already used the Storing in a Table technique as below -
QVW:
LOAD
QVW
FROM
Path\Deployment.xlsx
(ooxml, embedded labels, table is QVWs);
FOR Each vQVW in FieldValueList('QVW')
EXECUTE cmd.exe /C COPY "SOURCE" "DESTINATION";
NEXT vQVW
DROP TABLE QVW;
