Answer the question
In order to leave comments, you need to log in
How to get the result of a PW script execution in a BAT file?
Calling a PowerShell script from a BAT file. I want to check the call field in the BAT file, what value is returned - an empty string or not empty . If the string is empty, then go to section sec_1, if not empty, then sec_2. Can you tell me how to check the returned data from a PowerShell script in a BAT file?
Answer the question
In order to leave comments, you need to log in
BAT starts a process, and it can return 1 or 0 at the end of its work, just like any other.
The environment variable is called ~ErrorLevel.
How do I get the application exit code from a Wind...
This is how I got the date from PowerShell in the BATCH file:
I think you can customize it for yourself.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question