home *** CD-ROM | disk | FTP | other *** search
/ Freelog 34 / Freelog034.iso / Bas / Systeme / PrcView / pv.txt < prev    next >
Encoding:
Text File  |  2002-05-01  |  4.4 KB  |  102 lines

  1. pv.exe û PrcView command line utility allows automating common task like 
  2. figuring out if particular process is running or killing a running process 
  3. on scheduler.
  4.  
  5. Checking if  a particular process is running is easy. For example the 
  6. following command will show all instances of explorer that are running:
  7.     pv explorer.exe
  8.  
  9. Setting a process priority is another common task. To set explorer priority 
  10. to normal just type:
  11.     pv ûpn explorer.exe
  12. or if you like a æverboseÆ style
  13.     pv -p"Normal" explorer.exe
  14.  
  15. pv supports the common æ*Æ and æ?Æ wildcards so that the following command 
  16. will perfectly work by printing out all the processes starting with æeÆ
  17.     pv  e*
  18.  
  19. DonÆt like a particular process and would like to kill it? The following 
  20. command will do the job:
  21.     pv ûk thisprocess.exe 
  22.  
  23. And if you donÆt like additional questions and would like to force killing:
  24.     pv ûkf  thisprocess.exe
  25.  
  26. DonÆt like this particular instance of the process and know the window title? 
  27. The following command will do the job (please note that æ\Æ need to be 
  28. represented as a æ\\Æ combination if  you enter it from the command line):
  29.     pv -k thisprocess.exe -w"c:\\"
  30.  
  31. pv.exe can be easealy executed from a batch file to check if process is running. 
  32. When writing a command file please note that the ERRORLEVEL number specifies 
  33. a true condition if the last program run returned an exit code equal to or 
  34. _greater_ than the number specified. 
  35.  
  36. The following script illustrates how this could be done:
  37.  
  38. @echo off
  39. pv.exe %1 >nul
  40. if ERRORLEVEL 1 goto Process_NotFound
  41. :Process_Found
  42. echo Process %1 is running
  43. goto END
  44. :Process_NotFound
  45. echo Process %1 is not running
  46. goto END
  47. :END
  48.  
  49.  
  50. And finally a copy of the -? command:
  51.  
  52. Usage: pv -[<MODE>] -[<OPTIONS>] <ARGUMENTS>...-[<OPTIONS>]
  53. Modes:
  54.   -h,-?    --help      display this help information
  55.   -k       --kill      kill PROCESS
  56.   -a       --activate  activate PROCESS
  57.   -c       --close     close (send WM_CLOSE) to the PROCESS
  58.   -m       --module    show modules used by specified PROCESS
  59.   -g       --getenv    get startup environment for the  PROCESS
  60.   -p[nihr] --priority  set priority to "Normal", "Idle", "High", "RealTime"
  61.   -p[ba]   --priority  "Below Normal" and "Above Normal" only on W2K or highe
  62.   -t       --tree      display process tree
  63.   -u       --usage     show processes that uses specified MODULE
  64.   -s       --summary   show MODULE usage summary
  65.   -w,      --window    show only processes with visible windows, -e shows all
  66. Options:
  67.   -f,      --force     never prompt
  68.   -e,      --extend    show additional information if available
  69.   -i,      --id        use process ID instead of the PROCESS name
  70.   -q,      --quiet     supress headers and produce a tab-separated list
  71.   -d[time] --delay     delay time in milliseconds before executing command
  72.   -l[mask] --long      include process command line
  73.  
  74. Arguments can contain '*' and '?' wildcards.
  75. Process return code (%ERRORLEVEL%) can be used in batch files
  76. 0 - process found, 1 - empty result set, 2 - programm error
  77.  
  78. Examples:
  79.   pv myprocess.exe        get process ID for myprocess.exe.
  80.   pv -e                   get extended list of running processes.
  81.   pv -k sleep*            kill all processes starting with "sleep"
  82.   pv -m -e explorer.exe   get extended information about explorer's modules
  83.   pv -u oleaut*.dll       list of all processes that use matching dll
  84.   pv -ph w*.exe           set priority to hight for all matching processes
  85.   pv explorer.exe -l"*/S" looks for explorer process with /S switch
  86.  
  87.  
  88. Would like to add an example? Found any errors? Please write at support@prcview.com
  89. or contact me directly at igornys@writeme.com
  90.  
  91. -------------------------------------------------
  92. LIABILITY DISCLAIMER -- READ BEFORE using pv.exe
  93. THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESSED, 
  94. IMPLIED OR OTHERWISE, INCLUDING AND WITHOUT LIMITATION, ANY WARRANTY OF 
  95. MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL THE 
  96. AUTHOR OR HIS COMPANY BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR 
  97. CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR 
  98. LOSS OF PROFITS, BUSINESS INTERRUPTION, LOSS OF INFORMATION, OR ANY OTHER LOSS) , 
  99. WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, 
  100. ARISING OUT OF OR IN CONNECTION WITH THE USE OR INABILITY TO USE THIS SOFTWARE.
  101.  
  102.