Hey... I'm feeling like I must be missing something obvious here.
TCC 18.00.32 x64 Windows 10 6.3.10586.
What I'm trying to do is determine if a particular IP route has a specific route, and if so, which one (essentially to determine which of two VPNs are connected and how they're routing IP traffic)
From the command line, I can do this:
route print | find "192.168.0.110" | find "192.168.10.1"
echo %?
I'll either get a 0 if the route exists, or a 1 if it doesn't. But when I throw this in a BTM, I don't get any output from the route command, and I always get %? == 0.
A single "| find" works, it's only when I chain two together that it fails.
I could re-implement the logic to actually parse the "route print" properly instead of blindly looking for a couple of specific IPs, but this is "good enough" because it's really just a pre-check, I will later verify that the remote resources are actually available, but these checks take 5-10 seconds to fail and I was hoping to dump an error more quickly.
(If it isn't clear, I need to find a route for a specific IP, and then determine which of two gateways I was assigned. Depending on the gateway that is available, I'll then proceed in different directions)
Any clues why I can't chain two piped "find" commands in a BTM, but I can at the command line?
TCC 18.00.32 x64 Windows 10 6.3.10586.
What I'm trying to do is determine if a particular IP route has a specific route, and if so, which one (essentially to determine which of two VPNs are connected and how they're routing IP traffic)
From the command line, I can do this:
route print | find "192.168.0.110" | find "192.168.10.1"
echo %?
I'll either get a 0 if the route exists, or a 1 if it doesn't. But when I throw this in a BTM, I don't get any output from the route command, and I always get %? == 0.
A single "| find" works, it's only when I chain two together that it fails.
I could re-implement the logic to actually parse the "route print" properly instead of blindly looking for a couple of specific IPs, but this is "good enough" because it's really just a pre-check, I will later verify that the remote resources are actually available, but these checks take 5-10 seconds to fail and I was hoping to dump an error more quickly.
(If it isn't clear, I need to find a route for a specific IP, and then determine which of two gateways I was assigned. Depending on the gateway that is available, I'll then proceed in different directions)
Any clues why I can't chain two piped "find" commands in a BTM, but I can at the command line?