Search found 10 matches

by shashank.kaneria
28 Jan 2014 02:32
Forum: DOS Batch Forum
Topic: Get CPU and Run a EXE
Replies: 7
Views: 5745

Re: Get CPU and Run a EXE

foxidrive wrote:If you add a line after the WMIC line that delays a little bit then it will take far less CPU, such as this:

Code: Select all

ping -n 4 localhost >nul
or if you have Vista or later
timeout /t 3 /nobreak >nul



Okay, I have added the same.

its working more smooth now. GREAT.. !!!

Regards,
Shashank
by shashank.kaneria
26 Jan 2014 23:30
Forum: DOS Batch Forum
Topic: Get CPU and Run a EXE
Replies: 7
Views: 5745

Re: Get CPU and Run a EXE

The test.exe will run and the batch file will quit, with the addition below. wmic cpu where "loadpercentage > 90" get loadpercentage | find "LoadPercentage" >nul && (test.exe & goto :EOF) AWESOME !!! Worked well. I was using some variables, Flags, if-else... hahaha I...
by shashank.kaneria
25 Jan 2014 05:05
Forum: DOS Batch Forum
Topic: Get CPU and Run a EXE
Replies: 7
Views: 5745

Re: Get CPU and Run a EXE

This should work: wmic cpu where "loadpercentage > 90" get loadpercentage | find "LoadPercentage" >nul && test.exe AWESOME !!! its working. But in my scenario there is little bit more addition to be done, it should work only once whenever it find CPU more than 90%, it wi...
by shashank.kaneria
24 Jan 2014 05:37
Forum: DOS Batch Forum
Topic: Get CPU and Run a EXE
Replies: 7
Views: 5745

Get CPU and Run a EXE

Hi Folks, I am making a small DOS batch script. Scenario: A script which can take the LoadPercentage. if LoadPercentage is above 90% then it should run an executable(whatever it is). My findings (just an command): wmic cpu where "loadpercentage > 90" get loadpercentage This will provide me...
by shashank.kaneria
09 Jan 2014 00:35
Forum: DOS Batch Forum
Topic: Batch to kill (Killer Batch)
Replies: 15
Views: 19382

Re: Batch to kill (Killer Batch)

BRAVO !!! Final it Worked.... Code i am using is: :BEGIN @ECHO OFF &SETLOCAL for /f %%a in ('wmic path Win32_PerfFormattedData_PerfProc_Process where "Name = 'svchost' and PercentProcessorTime > 95" get IDProcess') do ( for /f %%b in ("%%~a") do taskkill /F /pid %%~b ) ping ...
by shashank.kaneria
08 Jan 2014 13:26
Forum: DOS Batch Forum
Topic: Batch to kill (Killer Batch)
Replies: 15
Views: 19382

Re: Batch to kill (Killer Batch)

Additionally it may crash other svchost.exe processes, as they may coordinating with other svchost.exe processes. In my scenario, When we access any remote machine so frequently then the antivirus McAfee agent utilizes the CPU(for check purpose). it makes the other process (only one svhost of NETWO...
by shashank.kaneria
08 Jan 2014 13:11
Forum: DOS Batch Forum
Topic: Batch to kill (Killer Batch)
Replies: 15
Views: 19382

Re: Batch to kill (Killer Batch)

Endoro wrote: Uii ... AYE SIR :mrgreen:


:D :D :D

Thanks Endoro.

Such a nice code, very helpful.

Thanks a ton


Regards,
Shashank
by shashank.kaneria
08 Jan 2014 04:59
Forum: DOS Batch Forum
Topic: Batch to kill (Killer Batch)
Replies: 15
Views: 19382

Re: Batch to kill (Killer Batch)

Hi Everyone, I have worked on that killer batch and reached up to certain level. Thanks Endoro... Your script worked in my remote machine, i have tried on mu local but because of some reasons it didnt worked. Code I used is: :BEGIN ECHO OFF wmic path Win32_PerfFormattedData_PerfProc_Process where &q...
by shashank.kaneria
08 Jan 2014 00:20
Forum: DOS Batch Forum
Topic: Batch to kill (Killer Batch)
Replies: 15
Views: 19382

Re: Batch to kill (Killer Batch)

[quote="Endoro"]how to get processes where the processor time is greater 90% AND the name is not "Idle" wmic path Win32_PerfFormattedData_PerfProc_Process where "Name != 'Idle' and PercentProcessorTime > 90" get Name,PercentProcessorTime,IDProcess Thanks. But its is not...
by shashank.kaneria
07 Jan 2014 04:19
Forum: DOS Batch Forum
Topic: Batch to kill (Killer Batch)
Replies: 15
Views: 19382

Batch to kill (Killer Batch)

Hi, I am working on a batch script which can kill process who use more than 90% of the CPU. Could anyone help me out... "My system is connected to 5 other windows system. to take some load from all of them. If any one of the connected system have 100% CPU then my system lost one machine among 5...