Avatar of Indarnav
Indarnav
 asked on

Run Defined Processes

VC++ code that keep running, allow only those processes to run which are defined in code, terminate all other processes as soon as they start. I know XP need certain processes for smooth operation, so assume all those will be added along with processes of my choice.
C++

Avatar of undefined
Last Comment
itsmeandnobodyelse

8/22/2022 - Mon
rowansmith

What are you trying to achieve?

If you are trying to stop users from running rogue/unauthorised software this is not going to work.

e.g., you will need to allow the System to run, using various system calls I can get the system to run my program as a thread which is not visible in the process table and which is not even started as a .exe

There is a good document here: http://www.interhack.net/pubs/email-trojan/

You need to educate your users, if they have access they can run whatever they want.  unless you introduce a code-signing system and lock the OS right down using the built in security.

-Rowan
Indarnav

ASKER
i understand ur concern, but still i insist please provide me let me try that too
trinitrotoluene

You can use the system() function provided in the stdlib header file to call a system function.

Check
http://www.cplusplus.com/reference/clibrary/cstdlib/system.html

The system functions you will need to call are as follows:

1) processes can be listed using tasklist.exe. I think this exists only on Win XP. Check the output of this command.

2) If you know the users on your system then

you can kill processes of a particular user as follows:

taskkill /F /FI "USERNAME eq Quinn"

Also check the below discussion for more info

http://www.tech-recipes.com/rx/446/xp_kill_windows_process_command_line_taskkill/
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Indarnav

ASKER
your all methods are inverse of what i m looking for. it is not possible to implement those for me. so please provide what i want.
Indarnav

ASKER
jkr, you are right, but that was in vbs and this i asked in vc++, anyway as u wish.
Indarnav

ASKER
ok
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Indarnav

ASKER
dear admin,

please ask some one to provide me code in vc++ for the query raised, so many days passed no suitabler reply received. it is getting delayed.
ASKER CERTIFIED SOLUTION
itsmeandnobodyelse

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.