I'm sure that it's possible somehow with typeperf, but I think that Powershell would be a better tool to use.
param ($ComputerName = "")
$np = get-process -Name notepad -ComputerName $ComputerName -ErrorAction SilentlyContinue
If ($np.count -eq 0) {
"Notepad is not running."
} else {
"There are {0} instances of Notepad that are running." -f $np.Count
}
try {
$svc = Get-Service -Name LanmanServer -ComputerName $ComputerName -ErrorAction Stop
if ($svc.Status -eq 'Running') {
"LanmanServer is running."
} else {
"LanmanServer is NOT running."
}
} catch {
"Error, the LanmanServer service is not defined."
}