0

I am looking for a way to identify if NIRCMD fails to do what i ask it to do. Is there a way to have NIRCMD to tell me if it fails?

Example:

"nircmd.exe" win activate title "Untitled - Notepad"

The above code works because I have this file open.

"nircmd.exe" win activate title "Untitled - Notepad12345"

The above code DOES NOT work because this window does not exist yet Nircmd acts like it runs ok in the CMD prompt and not giving any type of message letting me know it did not actually do what i asked it to do.

Also, the "NIRCMD showerror" results in no errors.

PY_
  • 1,189
  • 8
  • 18
  • 29
  • Does `nircmd.exe ... && (echo pass) || (echo fail)` respond correctly? or something like `mircmd.exe ... & if not ErrorLevel 1 (echo pass) else (echo fail)`? – aschipfl Aug 29 '19 at 15:34
  • They do not. Both pass even if notepad is not even open. – PY_ Aug 29 '19 at 15:50
  • Update: && (echo pass) || (echo fail) = Both Pass – PY_ Aug 29 '19 at 15:58
  • Update: && if not ErrorLevel 1 (echo pass) else (echo fail) = Both Fail – PY_ Aug 29 '19 at 15:58
  • I actually moved to another solution with a home grown C++ script since we were in a time crunch. Ill make sure to follow up with your questions first thing next week in case it helps someone else in the future. – PY_ Aug 30 '19 at 20:55

0 Answers0