windows tasklist only command code example
Example: uses tasklist to gett pid in batch file
tasklist /FI "ImageName eq cmd.exe" /FI "Status eq Running" /FO CSV
tasklist /FI "ImageName eq cmd.exe" /FI "Status eq Running" /FO CSV