Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need to find an easy way to copy the text from the programs list in Task Manager to a text file 5

Status
Not open for further replies.

jfelis

Technical User
Sep 13, 2003
23
AU

Hi There,

I run really long and complicated working sessions on my system and it is an absolute PAIN that I have to write down or type up a list of my running programs every time I have to shut down my system.

Does ANYONE know how I can copy the text shown in the Task Manager (see the attachment) into a text file that I can then restore my working environment when I restart? I know I can take a screen shot but that is pretty inelegant and I'd much prefer a text file, so I can manipulate the results.

Ciao, Jacq.
 
 http://files.engineering.com/getfile.aspx?folder=7db1694d-8baf-426b-bf61-07cf2de05b28&file=Task_Manager_Question.PNG
>Can we stay on track?
We are. The issue that I see is that, using basic Windows commands and free utilities, there seems to be no simple way to extract everything you want at one time. There might be a way, but I don't see it yet.

The command [tt][highlight #FCE94F]tasklist /v[/highlight][/tt] will give you everything you want in the "Window Title" column. EXCEPT, it will not show you the path of open Explorer windows.
 
I can select what I want to copy, it is just when I right click it "Copy" does not come up as one of my menu options.

Direct your complaints about that to Microsoft developers, but there is a reason why certain disparate components are not accessible by context menu commands when those elements are grouped in a UI dialogue.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.
 
Powershell might be your better bet

e.g

get-process explorer | format-list *

from the list you might see

Code:
Name                       : explorer
Id                         : 3332
PriorityClass              : Normal
FileVersion                : 10.0.14393.0 (rs1_release.160715-1616)
HandleCount                : 2418
WorkingSet                 : 104435712
PagedMemorySize            : 53907456
PrivateMemorySize          : 53907456
VirtualMemorySize          : 599531520
TotalProcessorTime         : 00:02:21.5468750
SI                         : 1
Handles                    : 2418
VM                         : 2199622787072
WS                         : 104435712
PM                         : 53907456
NPM                        : 91648
Path                       : C:\WINDOWS\Explorer.EXE
Company                    : Microsoft Corporation
CPU                        : 141.546875
ProductVersion             : 10.0.14393.0
Description                : Windows Explorer
Product                    : Microsoft® Windows® Operating System
__NounName                 : Process
BasePriority               : 8
ExitCode                   :
HasExited                  : False
ExitTime                   :
Handle                     : 2504
SafeHandle                 : Microsoft.Win32.SafeHandles.SafeProcessHandle
MachineName                : .
MainWindowHandle           : 196870
MainWindowTitle            :
MainModule                 : System.Diagnostics.ProcessModule (Explorer.EXE)
MaxWorkingSet              : 1413120
MinWorkingSet              : 204800
Modules                    : {System.Diagnostics.ProcessModule (Explorer.EXE), System.Diagnostics.ProcessModule
                             (ntdll.dll), System.Diagnostics.ProcessModule (KERNEL32.DLL),
                             System.Diagnostics.ProcessModule (KERNELBASE.dll)...}
NonpagedSystemMemorySize   : 91648
NonpagedSystemMemorySize64 : 91648
PagedMemorySize64          : 53907456
PagedSystemMemorySize      : 1032600
PagedSystemMemorySize64    : 1032600
PeakPagedMemorySize        : 75546624
PeakPagedMemorySize64      : 75546624
PeakWorkingSet             : 125935616
PeakWorkingSet64           : 125935616
PeakVirtualMemorySize      : 693301248
PeakVirtualMemorySize64    : 2199716556800
PriorityBoostEnabled       : True
PrivateMemorySize64        : 53907456
PrivilegedProcessorTime    : 00:01:15.4218750
ProcessName                : explorer
ProcessorAffinity          : 15
Responding                 : True
SessionId                  : 1
StartInfo                  : System.Diagnostics.ProcessStartInfo
StartTime                  : 15/01/2017 08:02:07
SynchronizingObject        :
Threads                    : {3504, 5312, 5656, 7024...}
UserProcessorTime          : 00:01:06.1250000
VirtualMemorySize64        : 2199622787072
EnableRaisingEvents        : False
StandardInput              :
StandardOutput             :
StandardError              :
WorkingSet64               : 104435712
Site                       :
Container                  :

Name                       : explorer
Id                         : 9456
PriorityClass              : Normal
FileVersion                : 10.0.14393.0 (rs1_release.160715-1616)
HandleCount                : 776
WorkingSet                 : 35004416
PagedMemorySize            : 50626560
PrivateMemorySize          : 50626560
VirtualMemorySize          : 355401728
TotalProcessorTime         : 00:05:06.5000000
SI                         : 1
Handles                    : 776
VM                         : 2199378657280
WS                         : 35004416
PM                         : 50626560
NPM                        : 45000
Path                       : C:\WINDOWS\explorer.exe
Company                    : Microsoft Corporation
CPU                        : 306.5
ProductVersion             : 10.0.14393.0
Description                : Windows Explorer
Product                    : Microsoft® Windows® Operating System
__NounName                 : Process
BasePriority               : 8
ExitCode                   :
HasExited                  : False
ExitTime                   :
Handle                     : 2936
SafeHandle                 : Microsoft.Win32.SafeHandles.SafeProcessHandle
MachineName                : .
MainWindowHandle           : 0
MainWindowTitle            :
MainModule                 : System.Diagnostics.ProcessModule (explorer.exe)
MaxWorkingSet              : 1413120
MinWorkingSet              : 204800
Modules                    : {System.Diagnostics.ProcessModule (explorer.exe), System.Diagnostics.ProcessModule
                             (ntdll.dll), System.Diagnostics.ProcessModule (KERNEL32.DLL),
                             System.Diagnostics.ProcessModule (KERNELBASE.dll)...}
NonpagedSystemMemorySize   : 45000
NonpagedSystemMemorySize64 : 45000
PagedMemorySize64          : 50626560
PagedSystemMemorySize      : 623112
PagedSystemMemorySize64    : 623112
PeakPagedMemorySize        : 437329920
PeakPagedMemorySize64      : 437329920
PeakWorkingSet             : 192835584
PeakWorkingSet64           : 192835584
PeakVirtualMemorySize      : 1229721600
PeakVirtualMemorySize64    : 2200252977152
PriorityBoostEnabled       : True
PrivateMemorySize64        : 50626560
PrivilegedProcessorTime    : 00:03:18.3593750
ProcessName                : explorer
ProcessorAffinity          : 15
Responding                 : True
SessionId                  : 1
StartInfo                  : System.Diagnostics.ProcessStartInfo
StartTime                  : 15/01/2017 16:27:34
SynchronizingObject        :
Threads                    : {13528, 8724, 7176, 5528...}
UserProcessorTime          : 00:01:48.1406250
VirtualMemorySize64        : 2199378657280
EnableRaisingEvents        : False
StandardInput              :
StandardOutput             :
StandardError              :
WorkingSet64               : 35004416
Site                       :
Container                  :

You can now select the items you want in your list.

e.g
Code:
PS C:\Users\Sean> get-process explorer | format-list name,path


Name : explorer
Path : C:\WINDOWS\Explorer.EXE

When you are satisfied you have everthing you need, remove explorer from the command

get-process | format-list name,path​

To list everything on the screen.

to save to a file

get-process | format-list name,path | out-file “c:\process.txt”​

Make sure you run powershell as Administrator or you get this:

Code:
PS C:\Users\Sean> get-process | format-list name,path | out-file “c:\process.txt”
out-file : Access to the path 'C:\process.txt' is denied.
At line:1 char:39
+ get-process | format-list name,path | out-file “c:\process.txt”
+                                       ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (:) [Out-File], UnauthorizedAccessException
    + FullyQualifiedErrorId : FileOpenFailure,Microsoft.PowerShell.Commands.OutFileCommand

reference:
ACSS - SME
General Geek
 
I know this is an old thread, but for closure's sake...

First of all, I think many of you misunderstood the OP's question. In task manager, the focus here is on the Applications tab, not the Processes tab. guitarzan's suggestion to use the command line tasklist /v does manage to capture that tab, but it also captures a LOT of other clutter making it difficult to sift out the unwanted data.

hairlessupportmonkey's first suggestion (get-process | where-object {$_.mainwindowhandle -ne 0} | select-object name, mainwindowtitle) gets very close, but still adds a bit of clutter and doesn't get it automatically into a text file. Here's how I'd modify that PowerShell command:

Code:
gps | ? {$_.mainwindowtitle.length -ne 0} | select mainwindowtitle | out-file C:\Temp\applications.txt

This takes out the name column and saves it right to a text file.


jfelis,
For future reference, you might want to show/express a little more patience. No one is getting paid to help you.

You may not be familiar with PowerShell, but running that command is easy. Simply go to your Start Menu, type powershell, and left-click "Windows PowerShell ISE". A window similar to the one below will open. Copy/paste that command I listed above and press enter. That's all there is to it. You can modify the location and name of the text file that gets created (keep in mind that if you have UAC enabled, you won't be able to save directly to C:\, so instead choose a subfolder that isn't a system folder).

PS_ISE_tucmcl.png



-Carl
"The glass is neither half-full nor half-empty: it's twice as big as it needs to be."

[tab][navy]For this site's posting policies, click [/navy]here.
 
 http://files.engineering.com/getfile.aspx?folder=e23515ff-268c-4aef-94ec-b5bcb9b15f86&file=PS_ISE.PNG
egodette said:
tasklist /FI "SESSIONNAME eq Console"

No, that does not produce the right list. This thread is about the Applications tab in task manager, not the Processes tab.
 
Hi, ThisHi,
This is a short response to let you know I saw the powershell info this morning and I'll try it out on the weekend as I've got 400 cacti in the house from my show on the previous weekend and my priority has to be to get them out before the lack of light damages them. FYI, to hairlessupportmonkey, I'm a Botanist who uses her computer extensively, NOT an IT professional! I did my Computer Science training back in the 1980s - so I got to be pretty good with Machine Code punch cards and Pascal, but the convolutions of Windows tend to get on my nerves.

I apologize to anyone who thought I was getting impatient, that was not so, it was just that from my perspective I wasn't getting an answer that I understood. I am always happy to learn something new, but some times I just need a bit more explanation that most folks. I usually don't even ask questions here unless I draw a blank elsewhere. I really do appreciate all the help,

Thanks, Jacq.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top