Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I run a Windows command and return true everytime?

My question is simple. I want to run a Windows command that always exits with a non-zero value on each run. I don't have access to command itself and want to manipulate the exit code when I call it. Sth like this:

C:\>run.cmd || echo "OK"

How can I achieve this?

Thanks in advance.

like image 745
leventunver Avatar asked Jan 07 '23 01:01

leventunver


1 Answers

In Windows command line, "echo" is not interpreted as a command and return code is not calculated. Thus, you have to use some other command. For your case, below code would be allright:

C:\>run.cmd || exit 0;
like image 189
Doruk Kutluay Avatar answered Jan 22 '23 22:01

Doruk Kutluay