Jump to content

Recommended Posts

Posted

Hey

I am making a batch file that helps people like me with crap pc's to get more cpu power out by stopping all processes except those that are truly vital. I have wriitne enough to stop all the servives and a "start" line to run a vbs script that frees up ram but i havent managed to stop processes running in the background like hp printer processes and that such. I need them running while i am working but games are a different story so stoppijng them starting up is out of the story.

I know that the command taskkill used to do the job but it doesnt seem to do it any more.

All the help will be appreciated. :thumbup


Posted

You could create little "database" consisting two files

Processes.bat

If "%1" EQU "" goto :EOF
If /i %1 EQU /start goto StartProcess
If /i %1 EQU /stop goto StopProcess
Goto :EOF

:StartProcess
for /f "usebackq" %%i IN (`type Processes.ini`) DO (
cmd /c start %%i
)
Goto :EOF

:StopProcess
for /f "usebackq" %%i IN (`type Processes.ini`) DO (
wmic process where name="%%i" call terminate
)
Goto :EOF

Processes.ini

name_of_process.exe

If you run processes.bat with parameter /start, it will launch all processes from processes.ini, if you start it with /stop, it will kill them all

Posted

Soulin you are the man :w00t:

thanks that fixed my problem prefectly. I should be finished in about an hour. I just have to touch up and try it out. But thanks so much. :thumbup

once agian thanks alot.

*clap*

*clap*

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...