Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
gines_rueda
Contributor III
Contributor III

How to catch EXECUTE command errors/messages.

Hello,

Is there a way to retrieve the error message that cmd.exe gives when I run this sentence in my QV script?

EXECUTE cmd.exe /C del "H:\file.csv" /q;

My point is that the file could be opened by a third party then the file would not be deleted, and no error or message will be return.

Thanks.

Ginés.

1 Solution

Accepted Solutions
maxgro
MVP
MVP

try with

EXECUTE cmd.exe /C  del "yourfile" /q  2>  delete.err;

the error should be written in the file delete.err

and then you can read (if exists) the file with Qlik

View solution in original post

2 Replies
maxgro
MVP
MVP

try with

EXECUTE cmd.exe /C  del "yourfile" /q  2>  delete.err;

the error should be written in the file delete.err

and then you can read (if exists) the file with Qlik

gines_rueda
Contributor III
Contributor III
Author

It would be nicer if this is captured by qlikview, but thanks, it worked.