Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

gines_rueda
New 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
MVP
MVP

Re: How to catch EXECUTE command errors/messages.

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

2 Replies
MVP
MVP

Re: How to catch EXECUTE command errors/messages.

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
New Contributor III

Re: How to catch EXECUTE command errors/messages.

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

Community Browser