i am trying to write a batch file which will run on certain machines in the domain and run the sysinternals (am i allowed to say that) pslist.exe.
what i have is:
echo off
echo.
echo This batch program checks all running processes on whatever computer is specified
echo.
echo **************************
echo Programs running on %1
echo **************************
pause
pslist -m \\%1
echo ***************************
echo FINISHED. EXIT?
echo ***************************
pause
what i am needing to know is where do i get the user input from??
i dont want to have to call for example:
batch.bat \\computername
i want to load the batch file and then have it prompt me to enter a computer name?
AND......i have also another program which i am tyring to run, this one does the same but it already has the cpmputer names entered ie.
echo off
echo.
echo This batch program checks all running processes in U16
echo.
echo **************************
echo Programs running on U16NO1
echo **************************
pause
pslist -m \\u16no1
echo **************************
echo Programs running on U16NO2
echo **************************
pause
pslist -m \\u16no2
echo **************************
echo Programs running on U16NO3
echo **************************
pause
pslist -m \\u16no3
echo **************************
echo Programs running on U16NO4
echo **************************
pause
and so on......
BUT what i really want to do is be able to ping the specified host first and if it pings back i want to execeute the pslist.exe but if it doesnt reply (ie turned off) i want to skip to the next ping of the next computer in the list.
something like:
echo off
echo.
echo This batch program checks all running processes in U16
echo.
echo **************************
echo Programs running on U16NO1
echo **************************
ping 10.0.0.0
pause
echo ***************************************
echo Do you now want to run pslist on U16NO1
echo ***************************************
IF I SAY YES IT WILL RUN THE NEXT LINE BUT IF I SAY NO IT WILL SKIP TO PINGING THE NEXT HOST.....
pslist -m \\u16no1
pause
ping 10.0.0.1
......... and so on...
i think it would be quite easy to do but am unsure of the IFs and CALL commands etc.
please help a wannabe scripter?
taloola
what i have is:
echo off
echo.
echo This batch program checks all running processes on whatever computer is specified
echo.
echo **************************
echo Programs running on %1
echo **************************
pause
pslist -m \\%1
echo ***************************
echo FINISHED. EXIT?
echo ***************************
pause
what i am needing to know is where do i get the user input from??
i dont want to have to call for example:
batch.bat \\computername
i want to load the batch file and then have it prompt me to enter a computer name?
AND......i have also another program which i am tyring to run, this one does the same but it already has the cpmputer names entered ie.
echo off
echo.
echo This batch program checks all running processes in U16
echo.
echo **************************
echo Programs running on U16NO1
echo **************************
pause
pslist -m \\u16no1
echo **************************
echo Programs running on U16NO2
echo **************************
pause
pslist -m \\u16no2
echo **************************
echo Programs running on U16NO3
echo **************************
pause
pslist -m \\u16no3
echo **************************
echo Programs running on U16NO4
echo **************************
pause
and so on......
BUT what i really want to do is be able to ping the specified host first and if it pings back i want to execeute the pslist.exe but if it doesnt reply (ie turned off) i want to skip to the next ping of the next computer in the list.
something like:
echo off
echo.
echo This batch program checks all running processes in U16
echo.
echo **************************
echo Programs running on U16NO1
echo **************************
ping 10.0.0.0
pause
echo ***************************************
echo Do you now want to run pslist on U16NO1
echo ***************************************
IF I SAY YES IT WILL RUN THE NEXT LINE BUT IF I SAY NO IT WILL SKIP TO PINGING THE NEXT HOST.....
pslist -m \\u16no1
pause
ping 10.0.0.1
......... and so on...
i think it would be quite easy to do but am unsure of the IFs and CALL commands etc.
please help a wannabe scripter?
taloola