Search found 6 matches

by xga
28 Jul 2012 18:56
Forum: DOS Batch Forum
Topic: Tasklist, multiple instances of a process and PID's
Replies: 2
Views: 4442

Tasklist, multiple instances of a process and PID's

Hi All, I'm writing a batch file to monitor a particular process every couple of minutes and if the memory of this process is over a certain threshold, it is killed and then restarted. I have this working now, but the problem I'm facing is when there are multiple instances of the same process. E.G. ...
by xga
29 Jun 2012 19:03
Forum: DOS Batch Forum
Topic: Obtaining memory usage of a process and string manipulation
Replies: 5
Views: 4650

Re: Obtaining memory usage of a process and string manipulat

I see that it reports in K without bytes as you said. This sort of thing should work - I don't see the need for the delims in my window in Win7. You might need the /f switch in taskkill (Untested) Code: @echo off :loop set "task=process.exe" for /f "tokens=5,6" %%A in ('tasklist...
by xga
29 Jun 2012 18:39
Forum: DOS Batch Forum
Topic: Obtaining memory usage of a process and string manipulation
Replies: 5
Views: 4650

Re: Obtaining memory usage of a process and string manipulat

CMD math is limited to 2^31 or around 2.1 gb

Is that going to be a problem?


No, I'm only wanting to monitor the memory up to 1.5 GB or 1,500,000 KB.
by xga
29 Jun 2012 09:30
Forum: DOS Batch Forum
Topic: Obtaining memory usage of a process and string manipulation
Replies: 5
Views: 4650

Obtaining memory usage of a process and string manipulation

Hi Guys, I'm trying to write a dos batch file to monitor the memory usage of a certain process and once it reaches a certain threshold, restart the process. The code below reports the memory usage of process.exe in kilobytes. E.g. 100,000 for /f "tokens=5,6 delims=: " %%A in ('tasklist /nh...
by xga
04 Jan 2012 02:54
Forum: DOS Batch Forum
Topic: Processing a group of files at a time in a single folder
Replies: 3
Views: 4184

Re: Processing a group of files at a time in a single folder

Hi Aacini, Thank you very much for your prompt reply. I had a problem with the group variable incrementing, so I changed the line "group+=1" to "set /a group+=1" and now the script is working perfectly. @echo off setlocal EnableDelayedExpansion set i=0 set group=0 set "fiveF...
by xga
03 Jan 2012 23:36
Forum: DOS Batch Forum
Topic: Processing a group of files at a time in a single folder
Replies: 3
Views: 4184

Processing a group of files at a time in a single folder

Hi Guys, I'm wanting to process approximately 20 random files in a single folder so that they are rar'ed (compressed using the 3rd party rar.exe command) in groups of 5 files, making for a total of 4 rar files (rar1.rar, rar2.rar, rar3.rar and rar4.rar), containing all of the 20 files. Ideally I wan...