Write TASKLIST output to text file using VBA
Posted on 2011-10-26
I am trying to execute the TASKLIST command using VBA, writing the output to a csv text file. It isn't working.
If I execute the following from a CMD window, if works:
TASKLIST /V /NH /FO CSV >C:\Temp\TaskList.txt
But if I try the following Sub, nothing happens:
Public Sub GetTaskList()
Shell "TASKLIST /V /NH /FO CSV >C:\Temp\TaskList.txt"
On Error GoTo 0
What am I doing wrong? Can I even do this?
I am on an XP platform running Access 2007