get windows machine name code example Example: get windows service name cmd sc queryex type= service state= all | find /i "keyword"