.Bat Change priority process several times
Moderator: DosItHelp
-
- Posts: 4
- Joined: 16 Feb 2020 07:53
.Bat Change priority process several times
I need a .bat file that changes the process priority several times, contains several processes with the same name, so I need the command to put the PID, I would like the process to be decreasing and increasing the priority alone, for 2min.
Can someone do this for me?
I need the process to change from high to low, after low to below normal, keep changing for 2min, the sequence does not matter.
What do I need to inform so that you can write a .bat like this for me? Thanks
Can someone do this for me?
I need the process to change from high to low, after low to below normal, keep changing for 2min, the sequence does not matter.
What do I need to inform so that you can write a .bat like this for me? Thanks
-
- Posts: 4
- Joined: 16 Feb 2020 07:53
Re: .Bat Change priority process several times
upppp, help plz
Re: .Bat Change priority process several times
See https://superuser.com/questions/620724/ ... mmand-line
The class has also a ProcessID member that you can use in the WHERE clause:
Steffen
The class has also a ProcessID member that you can use in the WHERE clause:
Code: Select all
wmic process where processid=12345 CALL setpriority 32768
-
- Posts: 4
- Joined: 16 Feb 2020 07:53
Re: .Bat Change priority process several times
Can you write the code for me? I need the process to change the priority several times during 2 min, going from low to high, I don't know how to do that, if you can write the code for me, I'll be very grateful, thanksaGerman wrote: ↑17 Feb 2020 03:42See https://superuser.com/questions/620724/ ... mmand-line
The class has also a ProcessID member that you can use in the WHERE clause:SteffenCode: Select all
wmic process where processid=12345 CALL setpriority 32768
-
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: .Bat Change priority process several times
That is the code
Re: .Bat Change priority process several times
Please see the linked thread on SO. There are several priority levels. No idea what levels you're referring to. Include it in your batch file and come back with your code and a description of what still didn't work and/or the error message if you're facing any problems.
Steffen
Steffen
-
- Posts: 4
- Joined: 16 Feb 2020 07:53
Re: .Bat Change priority process several times
wmic process where processid=12345 CALL setpriority 32768
I need .bat to make the process change its priority several times, going from normal to low, low to high, high to below normal, etc ... the sequence doesn't matter, I wanted the process to continue changing the priority for at least 2 minutes. Can anyone do this for me?
I need .bat to make the process change its priority several times, going from normal to low, low to high, high to below normal, etc ... the sequence doesn't matter, I wanted the process to continue changing the priority for at least 2 minutes. Can anyone do this for me?
Re: .Bat Change priority process several times
This might help you (just because you are here for the first time and i felt like it, but usually you have to try more than that):
penpen
Code: Select all
@echo off
setlocal enableExtensions enableDelayedExpansion
:: use the existing of a file as a signal
set "signal=signal.tmp.txt"
>"%signal%" rem:
:: delete file after 2 minutes == 120 seconds
start "" /b "%ComSpec%" /c"@(>nul timeout /t 3 /nobreak & del "%signal%")"
:loop
for %%a in ("high priority" "idle" "below normal" "normal") do for %%b in ("12345") do (
if exist "%signal%" echo(wmic process where processid=%%~b CALL setpriority "%%~a"
)
if exist "%signal%" goto :loop
echo(Bye.
pause
goto :eof