How to Get a List of Running Applications (Not Just Processes)
When you look at the Task Manager, there's a difference between the long list of background "Processes" and the shorter, more user-friendly list of "Apps" that have a visible window on the taskbar. For a script, getting this list of "apps" is a common task for user-activity logging, UI automation, or for generating a report of what a user is currently working on.
This guide will teach you how to get this specific list of running applications with visible windows using the built-in tasklist.exe command. You will learn the specific filters required to separate applications from background processes and how to parse this information for use in your scripts.
The Challenge: Process vs. Application
In Windows, nearly everything that runs is a "process." svchost.exe, explorer.exe, and Notepad.exe are all processes. However, from a user's perspective, an "application" is a process that has a visible window.
svchost.exe: A background process. It has no window.Notepad.exe: An application. It has a main window with a title.
Our goal is to filter the full process list to find only those that have a non-generic window title.
The Core Command: tasklist with Filters
The tasklist.exe utility is the command-line tool for listing processes. By itself, it doesn't give us what we need. We must use its filtering capabilities.
Command: tasklist /V /FI "STATUS eq RUNNING" /FI "WINDOWTITLE ne N/A"
/V: Verbose. This is the most important switch, as it adds the Window Title column to the output./FI "STATUS eq RUNNING": A Filter that selects processes whose status is "Running."/FI "WINDOWTITLE ne N/A": This is the key. It adds a second filter that selects processes where the Window Title is not equal to "N/A" (Not Applicable). This is how we filter out most background processes.
The Key to Finding Applications: The "Window Title"
As explained above, the "Window Title" is the property that distinguishes an application from a background process. If a process has a window title, it's a GUI application that the user can see and interact with. If the title is "N/A", it's a background or console process.
Example Script: A Basic List of Running Apps
This script uses the recommended tasklist command to generate a clean list of just the names of the running applications.
@ECHO OFF
ECHO --- Listing Running Applications (with visible windows) ---
ECHO.
ECHO Image Name | Window Title
ECHO ==================== | =======================================
REM 'tokens=1,9,*' grabs the process name (1) and the window title (9 onwards).
REM The header from tasklist is 3 lines long with /V, so we skip it.
FOR /F "skip=3 tokens=1,9,*" %%A IN (
'tasklist /V /FI "STATUS eq RUNNING" /FI "WINDOWTITLE ne N/A"'
) DO (
ECHO %%A | %%B
)
How the script works:
tasklist /V /FI "..." /FI "...": This command is executed first. It queries the system and produces a table of only the running processes that have a window title.FOR /F "skip=3 tokens=1,9,*" %%A IN ('...'): TheFORloop captures this output.skip=3: The verbose output fromtasklisthas a 3-line header (Image Name...,=======...,...). This skips those lines.tokens=1,9,*: This is the parsing logic. It tells theFORloop to grab the 1st token (the Image Name), and the 9th token and all subsequent tokens (9,*). The Window Title is always the 9th column in the verbose output. This assigns the process name to%%Aand the window title to%%B.
ECHO %%A | %%B: This displays the two captured pieces of information in a custom format.
Common Pitfalls and How to Solve Them
-
Administrator Rights: A standard user can only see their own applications. To get a complete list of all applications running under all user accounts (e.g., on a Remote Desktop Server), you must run the script as an Administrator.
-
Console Applications: This method will list any command prompt window that has a custom title, as it meets the "has a window title" criteria. This is generally the desired behavior.
-
"No tasks are running...": If no GUI applications are running, the
tasklistcommand will return this message. TheFOR /Floop will simply not execute, resulting in an empty list, which is the correct and safe outcome.
Practical Example: A "Check for Running App" Script
This script checks if a specific application is already running before launching a new instance. This is useful for applications that should only be run once.
@ECHO OFF
SETLOCAL
SET "AppName=notepad.exe"
SET "IsRunning=0"
ECHO --- Checking if %AppName% is already running ---
ECHO.
REM We check for the app by its image name and also that it has a window.
tasklist /FI "IMAGENAME eq %AppName%" /FI "WINDOWTITLE ne N/A" | find /I "%AppName%" > NUL
IF %ERRORLEVEL% EQU 0 (
ECHO [INFO] An instance of %AppName% is already running.
) ELSE (
ECHO [ACTION] %AppName% is not running. Launching it now...
START "" "%AppName%"
)
ENDLOCAL
This is a more efficient check than parsing the full list. It uses tasklist's own filters to do the hard work and then uses find to simply check if any result was returned.
Conclusion
While tasklist is a tool for listing processes, its powerful filtering capabilities allow you to easily refine its output to get a list of what a user would consider "running applications."
- The core command is
tasklist /V /FI "WINDOWTITLE ne N/A". - The
/V(Verbose) switch is essential as it provides the Window Title information. - The
/FIfilter is the key to separating applications from background processes. - Run the script as an Administrator to see applications running under all user accounts.
By using this technique, you can write scripts that are aware of the applications a user is actively working with, opening the door for more intelligent automation and system monitoring.