-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSimpleConnect.bat
79 lines (70 loc) · 2.57 KB
/
SimpleConnect.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
@echo off
setlocal enabledelayedexpansion
title SimpleConnect
:menu
cls
echo SimpleConnect - Detailed Process Monitor
echo ============================================
echo.
echo 1. Filter by process name
echo 2. Show all processes
echo 3. Filter by process ID
echo 4. Exit
echo.
set /p choice="Select an option (1-4): "
if "%choice%"=="1" (
set /p processName="Enter the process name to filter (e.g., notepad.exe) or leave blank for all processes: "
goto loop
) else if "%choice%"=="2" (
goto showAllProcesses
) else if "%choice%"=="3" (
set /p processID="Enter the process ID to filter (e.g., 1234): "
goto filterByID
) else if "%choice%"=="4" (
exit
) else (
echo Invalid option, please try again.
timeout /t 1 >nul
goto menu
)
:loop
cls
echo SimpleConnect - Detailed Process Monitor
echo ============================================
echo.
if "%processName%"=="" (
echo Showing all processes:
echo ------------------------------
wmic process get Caption, ProcessId, CommandLine, ExecutablePath, WorkingSetSize, ReadOperationCount, WriteOperationCount, ThreadCount, CreationDate, Priority, TerminationDate, HandleCount, PageFileUsage /format:list
) else (
echo Showing processes matching: %processName%
echo ------------------------------
wmic process where "Caption='%processName%'" get Caption, ProcessId, CommandLine, ExecutablePath, WorkingSetSize, ReadOperationCount, WriteOperationCount, ThreadCount, CreationDate, Priority, TerminationDate, HandleCount, PageFileUsage /format:list
)
echo.
timeout /t 1 >nul
goto loop
:showAllProcesses
cls
echo SimpleConnect - Showing All Processes
echo ============================================
echo.
wmic process get Caption, ProcessId, CommandLine, ExecutablePath, WorkingSetSize, ReadOperationCount, WriteOperationCount, ThreadCount, CreationDate, Priority, TerminationDate, HandleCount, PageFileUsage /format:list
echo.
timeout /t 10 >nul
goto showAllProcesses
:filterByID
cls
echo SimpleConnect - Filtering by Process ID
echo ============================================
echo.
if "%processID%"=="" (
echo No Process ID entered.
) else (
echo Showing details for Process ID: %processID%
echo ------------------------------
wmic process where "ProcessId='%processID%'" get Caption, ProcessId, CommandLine, ExecutablePath, WorkingSetSize, ReadOperationCount, WriteOperationCount, ThreadCount, CreationDate, Priority, TerminationDate, HandleCount, PageFileUsage /format:list
)
echo.
timeout /t 1 >nul
goto filterByID