I have a macro as attached that runs the command to check the file lock status. It works sometime. But it fails frequently.
The error message is: The external program "c:\windows\system32\cmd.exe" returned an error code: 1
I have tried to run the BAT file manually created from this workflow and it worked each time. So I don't know what is causing the error.
I added below code in the Arguments and then see in the log.txt file this message: Access is denied.
> %temp%\log.txt 2>&1