get pid as value from tasklist 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