\
Tips and Tricks
Tools
PV.EXE
Useful as a command line process killer. Can also list tasks.
This is a freeware tool which is available as part of the
"PrcView
" download.
I've also noticed that the versions listed on the site are incorrect
and a newer version is available as a separate download....
The syntax of the one I have is shown below.
pv displays information about the running processes.
pv v 5.2.2.7, Copyright (c) Igor Nys, 2000-2006.
Usage: pv -[<OPTION>]... <ARGUMENT>... -[<OPTION>]
Modes:
-s --summary show usage for the specified MODULE
-h,-? --help display this help information
Actions:
-k --kill kill process
-a --activate brings process main window in the foreground
-c --close close (send WM_CLOSE) to the PROCESS
-p[nihr] --priority set priority to "Normal", "Idle", "High", "Real Time"
[ba] "Below Normal" and "Above Normal" only on W2K or higher
Output Options:
-e, --extend show additional information if available
-q[header],--quiet supress headers and produce a tab-separated list
-b --bare show process ID only ()
-o<format> --output control output using the format string (see below)
Input Options:
-f, --force never prompt
-i, --id use process ID instead of the PROCESS name
Filters:
-l[mask] --long include processes with command line matching mask
-w[mask] --window show processes with visible windows matching mask,
-e includes in search also invisible windows
-u[mask] --usage show processes using modules that matches mask
-y[mask] --user show processes that run under specified user account
-t[root] --tree display process tree starting starting from the root
Extra Information Options:
-g --getenv get startup environment for the PROCESS
-m --module show modules used by specified PROCESS
Execution Options:
-d[time] --delay delay time in milliseconds before executing command
-r[err] --repeat repeat command in a cycle, while (%ERRORLEVEL% > err)
-n --number %ERRORLEVEL% = negated number of matched processes
-x[a] --exit wait for the process completion (exit)
'a' flag waits for all processes, -d sets time-out
-@[file_name] read arguments from specified file or from
standard input after processing the command line
Arguments can contain '*' and '?' wildcards.
Use return code (%ERRORLEVEL%) in batch files:
0 - process found (negated number of processes if -n is specified)
1 - empty result set, 2 - programm error
Format string can use the following placeholders to control the output
%a affinity, %d creation time, %c[time] % cpu
%f full path, %e elapsed cpu time, %i process id
%l command line, %n image name, %m memory (K)
%p priority, %r parent id, %s signature
%t thread count, %u user name, %v version
Specify an optional performance data collecting time in milliseconds after the %c switch, default is 500ms.
Examples:
pv myprocess.exe get process ID for myprocess.exe.
pv -e get extended list of running processes.
pv -k sleep* kill all processes starting with "sleep"
pv -m -e explorer.exe get extended information about explorer's modules
pv -u oleaut*.dll list of all processes that use matching dll
pv -ph w*.exe set priority to hight for all matching processes
pv explorer.exe -l"*/S" looks for explorer process with /S switch
pv -r0 -d2000 calc.exe "2>nul"
checks every 2 seconds if calc.exe is running
pv --user:SYSTEM shows processes running under system account
pv -o"%i\t%e\t%c2000%%\t%m(K)\t%n" pv.exe sqlservr.exe
shows memory and CPU information collected for 2 sec.