Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

EXECUTE command setting on Publisher

Hi

I have a load script that uses the Execute command to delete a file.

It works fine run from QV Desktop, but not when run from Publisher.  Is there something I have to set in QMC to allow Publisher to call cmd.exe via Execute ?

Many Thanks,     Bill

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Jaime

Unfortunately your suggestion did not sort it.

But I have sussed it though.  The issue was that I was trying to delete the file as per a relative path and it seems that when one breaks out to CMD.EXE via EXECUTE you do not end up in the same folder as the running qvw resides in [if this folder is a unc path] so the relative path pointed to the wrong [& non existent] folder.  So I have done some string manipulation to using the DocumentPath() to get around this.

See excerpt from log file below.

20 May 2014 10:50:50: 0062    let vStoreQVDPath =  mid ( DocumentPath() , 1 ,  index(DocumentPath() , '\' , -1 ) ) & vTempFolder

20 May 2014 10:50:50: 0063    trace  *****  vStoreQVDPath  \\emea.menzies.net\BI\Data\QV.Test\QVD.Generate\Hermes\..\..\QVD\Temp\

20 May 2014 10:50:50: 0063    *****  vStoreQVDPath  \\emea.menzies.net\BI\Data\QV.Test\QVD.Generate\Hermes\..\..\QVD\Temp\

Best Regards,     Bill

View solution in original post

3 Replies
jaimeaguilar
Partner - Specialist II
Partner - Specialist II

Hi,

I've seen that some CMD commands do not seem to be recognized or ignored by QlikView. Some days ago I needed to execute a rename command, however it never worked, so I decided to use the copy command instead of the rename one and it worked. Maybe its the same issue. In your case you can try either DEL or ERASE.

Just to confirm are you using this syntax?

EXECUTE CMD.EXE DEL /F /S /Q /A "C:\Folder\File.Extension"

or

EXECUTE CMD.EXE ERASE /F /S /Q /A "C:\Folder\File.Extension"

I think the /Q is mandatory here so the file is erased without confirmation, and the other parameters may be optional,

hope it helps,

regards

Anonymous
Not applicable
Author

Jaime

Many thanks for the suggestion.

I'll give it a go & tell you what happens.

Many Thanks,     Bill

Anonymous
Not applicable
Author

Jaime

Unfortunately your suggestion did not sort it.

But I have sussed it though.  The issue was that I was trying to delete the file as per a relative path and it seems that when one breaks out to CMD.EXE via EXECUTE you do not end up in the same folder as the running qvw resides in [if this folder is a unc path] so the relative path pointed to the wrong [& non existent] folder.  So I have done some string manipulation to using the DocumentPath() to get around this.

See excerpt from log file below.

20 May 2014 10:50:50: 0062    let vStoreQVDPath =  mid ( DocumentPath() , 1 ,  index(DocumentPath() , '\' , -1 ) ) & vTempFolder

20 May 2014 10:50:50: 0063    trace  *****  vStoreQVDPath  \\emea.menzies.net\BI\Data\QV.Test\QVD.Generate\Hermes\..\..\QVD\Temp\

20 May 2014 10:50:50: 0063    *****  vStoreQVDPath  \\emea.menzies.net\BI\Data\QV.Test\QVD.Generate\Hermes\..\..\QVD\Temp\

Best Regards,     Bill