Replaces the command " tasklist "
Moderator: DosItHelp
Replaces the command " tasklist "
Does anyone know if there is a command for Windows 2000 that replaces the command " tasklist ".
"tasklist > %tempfile%" Command used to write to a file processes in the task. But on Windows 2000 I do not write anything while it works on XP.
I tried to use the commands " PuList " and " tlist " but do not function.
I await an answer thanks
"tasklist > %tempfile%" Command used to write to a file processes in the task. But on Windows 2000 I do not write anything while it works on XP.
I tried to use the commands " PuList " and " tlist " but do not function.
I await an answer thanks
Re: Replaces the command " tasklist "
qprocess / query process -if you have terminal services.
wmic process get - if you have wmic
the last resort are the wmic objects which should be accessible with vbscrtip/jscript/
EDIT - for windows 2000 windows script host is available as additional download (needed for vbscript/jescript ) - https://www.microsoft.com/en-us/downloa ... x?id=20240
wmic process get - if you have wmic
the last resort are the wmic objects which should be accessible with vbscrtip/jscript/
EDIT - for windows 2000 windows script host is available as additional download (needed for vbscript/jescript ) - https://www.microsoft.com/en-us/downloa ... x?id=20240
Re: Replaces the command " tasklist "
Then I have to write the code that is this :
@echo off
set tempfile=bdw.txt
del %tempfile%
tasklist > %tempfile%
type %tempfile% | find /i "iexplore.exe"
if errorlevel 0 if not errorlevel 1 goto IsRunning
start iexplore
exit
del %tempfile%
pause
exit
:IsRunning
echo IsRunning
goto exit
:loop
taskkill /im "iexplore.exe" /fi "STATUS eq NOT RESPONDING" /f >nul && start "" "C:\Programmi\Internet Explorer\iexplore.exe"
goto loop
On Windows XP works perfectly on Windows 2000 I do not write the file so it does not work processes .
I also tried the command that you told me but I can not get it going . Still does not write to the file
@echo off
set tempfile=bdw.txt
del %tempfile%
tasklist > %tempfile%
type %tempfile% | find /i "iexplore.exe"
if errorlevel 0 if not errorlevel 1 goto IsRunning
start iexplore
exit
del %tempfile%
pause
exit
:IsRunning
echo IsRunning
goto exit
:loop
taskkill /im "iexplore.exe" /fi "STATUS eq NOT RESPONDING" /f >nul && start "" "C:\Programmi\Internet Explorer\iexplore.exe"
goto loop
On Windows XP works perfectly on Windows 2000 I do not write the file so it does not work processes .
I also tried the command that you told me but I can not get it going . Still does not write to the file
Re: Replaces the command " tasklist "
open a command prompt and check if the command
query process
will produce error.
if not download the windows script host from the link in my previous comment and I'll create a script that list the processes with their pids.
Also you can check if MSHTA command can be ran - if yes there'll be no need to download the WSH.
I totally don't know what the win2000 is capable of as it is pretty ancient .
query process
will produce error.
if not download the windows script host from the link in my previous comment and I'll create a script that list the processes with their pids.
Also you can check if MSHTA command can be ran - if yes there'll be no need to download the WSH.
I totally don't know what the win2000 is capable of as it is pretty ancient .
Re: Replaces the command " tasklist "
I tried to install the executable over and nothing has changed .
I tried to run the cmd " query process " and by mistake while " MSHTA " does not give me no errors but does nothing .
I do not know how to find a command instead of " tasklist " for Windows 2000. Other ideas ?
I tried to run the cmd " query process " and by mistake while " MSHTA " does not give me no errors but does nothing .
I do not know how to find a command instead of " tasklist " for Windows 2000. Other ideas ?
Re: Replaces the command " tasklist "
So you have mshta.
Save this as a .bat and run it in the console and check its output:
Save this as a .bat and run it in the console and check its output:
Code: Select all
@if (@X)==(@Y) @end /* JSCRIPT COMMENT **
@echo off
setlocal
rem if "%~1" equ "" echo pass the process name as forst argument && exit /b 1
:: first argument is the process you want to check if running
rem set process_to_check=%~1
mshta "about:<script language='javascript' src='file://%~dpnxf0'></script>"|more
rem mshta "about:<script language='javascript' src='file://%~dpnxf0'></script>" | find /i "%process_to_check%" >nul 2>&1 && (
rem echo process %process_to_check% is running
rem ) || (
rem echo process %process_to_check% is not running
rem )
endlocal
exit /b
************** end of JSCRIPT COMMENT **/
var fso= new ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1);
var winmgmts = GetObject("winmgmts:\\\\.\\root\\cimv2");
var colProcess = winmgmts.ExecQuery("Select * from Win32_Process");
var processes = new Enumerator(colProcess);
for (;!processes.atEnd();processes.moveNext()) {
var process=processes.item();
fso.Write( process.processID + " " + process.Name + "\n");
}
close();
Re: Replaces the command " tasklist "
Then output it gives me is what's in the picture :http://uploadpie.com/iFAlx
Then I do not understand that command should put instead of tasklist after you run this script .
Sorry for the inconvenience and thank you.
Then I do not understand that command should put instead of tasklist after you run this script .
Sorry for the inconvenience and thank you.
Re: Replaces the command " tasklist "
looks like the mshta wont help here...
Re: Replaces the command " tasklist "
In what sense it should help . I replace this code : " tasklist > % tempfile % " with this " mshta > % % tempfile "???
Re: Replaces the command " tasklist "
it should display all running processes bus is not capable to do it on win2000.
I have no idea what else could help - may be compiled windwos 2000 resource tool kit - https://support.microsoft.com/en-us/kb/927229 and pulist
I have no idea what else could help - may be compiled windwos 2000 resource tool kit - https://support.microsoft.com/en-us/kb/927229 and pulist
Re: Replaces the command " tasklist "
It does not work even after installing the executable " PuList " and putting as line of code : " pulist > % tempfile % "
I do not know how to treat the problem
I do not know how to treat the problem
Re: Replaces the command " tasklist "
check if the pulist is the the %path%
or easier - put the executable in the same directory as the script or where console is opened.
Honestly I have no idea what to suggest more. Better update your windows.
or easier - put the executable in the same directory as the script or where console is opened.
Honestly I have no idea what to suggest more. Better update your windows.
Re: Replaces the command " tasklist "
Did you try pslist from Sysinternals
Mark Russinovich - Sysinternals
Mark Russinovich - Sysinternals
Re: Replaces the command " tasklist "
Yes but does not work.
I try it with this syntax : " pslist > % tempfile % "
You mean like this ?
I try it with this syntax : " pslist > % tempfile % "
You mean like this ?
Re: Replaces the command " tasklist "
ReAslan wrote:Yes but does not work.
I try it with this syntax : " pslist > % tempfile % "
You mean like this ?
What do you see on the cmd screen when you type
Code: Select all
pslist
Do you see a list of the processes? You need to download pslist.