How to execute the below command in ant target with < exec > task.
wmic nic where 'netconnectionid like '%'' get netconnectionid
If I run above in command line, I can get this output:
NetConnectionID
Local Area Connection
Local Area Connection 2
However, if I call this command via this way:
<target name="test">
<exec executable="wmic">
<arg line="nic where 'netconnectionid like '%'' get netconnectionid"/>
</exec>
</target>
I got below error:
[exec] Node - MyComputer
[exec] ERROR:
[exec] Description = Invalid query
[exec]
[exec]
[exec] Result: -2147217385
Anyone can help me? Thank you!
"
for double quotes, and'
for single quotes. Will that help? – David W.