Sign in to follow this  
Followers 0
oageng

How can I run two executables under a single process?

10 posts in this topic

I have two executable files: one I called it sysdps.exe and the other is called Test Engine.exe. These files are supposed work together. I'm a technician for a school. Students take the exams/tests on computers. Test Engine.exe is the one that runs the exam, and sysdps.exe is the one I created to block taking of screen shots of the exam (I problem we faced for a long time). I created sysdps.exe with your help, thanks a lot.

I want to make the programs run at the same time and exit at the same time, something like that. May be make one the child of another process - I dont know if this will stop killing of one process leaving the other behing?

I want a behaviour such that when you try to exit each process they both go. May be it could also pop up a message like "Are you sure you want to close the exam?" . How do I do this?

I need you help

---------------------------

MCSE--MCSA--N+--A+

Share this post


Link to post
Share on other sites



check if the other process exists, if not then exit

Share this post


Link to post
Share on other sites

I have two executable files: one I called it sysdps.exe and the other is called Test Engine.exe. These files are supposed work together. I'm a technician for a school. Students take the exams/tests on computers. Test Engine.exe is the one that runs the exam, and sysdps.exe is the one I created to block taking of screen shots of the exam (I problem we faced for a long time). I created sysdps.exe with your help, thanks a lot.

I want to make the programs run at the same time and exit at the same time, something like that. May be make one the child of another process - I dont know if this will stop killing of one process leaving the other behing?

I want a behaviour such that when you try to exit each process they both go. May be it could also pop up a message like "Are you sure you want to close the exam?" . How do I do this?

I need you help

---------------------------

MCSE--MCSA--N+--A+

What method does sysdps.exe use to block printscreen? Any reason it can't be in the same executable with Test Engine.exe? If the code in Test Engine.exe doesn't have any blocking points (i.e. no MsgBox(), GUIs run in event mode, etc.).

If they still need to be separate, an AdLibEnable() function in can periodically test that sysdps.exe is running and if not react as appropriate. But blocking points can still break this method too.

If it's a classroom machine you have firm control over, then sysdps.exe can be a Service or scheduled task run so that the test-taker wouldn't have rights to stop it.

^_^


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

check if the other process exists, if not then exit

Please help with the coding

Share this post


Link to post
Share on other sites

check if the other process exists, if not then exit

This would require a 3rd process. The real answer here is to run the blocking program as a service.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

What method does sysdps.exe use to block printscreen? Any reason it can't be in the same executable with Test Engine.exe? If the code in Test Engine.exe doesn't have any blocking points (i.e. no MsgBox(), GUIs run in event mode, etc.).

If they still need to be separate, an AdLibEnable() function in can periodically test that sysdps.exe is running and if not react as appropriate. But blocking points can still break this method too.

If it's a classroom machine you have firm control over, then sysdps.exe can be a Service or scheduled task run so that the test-taker wouldn't have rights to stop it.

^_^

No, these are not desired effects. Right now sysdps.exe and test engine.exe run nicely as separate processes. I do not want (actually I cannot) to embed sysdps.exe into Test Engine.exe. I dont know how Test Engine.exe was programmed, and I'm not interested in knowing now. I do not want to decompile it; I'm also still learning how to program.

I created 2 batch files, one that calls sysdps.exe and Test Engine.exe and waits for Test Engine.exe to complete and finally kills sysdps.exe. The other batch actually calls the other file batch file, hides the files and does a clean up by deleting files after the exam. Everything is cool about these batch files. But I want to get rid of them as well for security reasons.

I want to produce an executable that can call these 2 programs (sysdps.exe and Test Engine.exe) and make sure that they are not exited individually through a tool that kills processes like task manager.

One more thing I do not want to schedule. I want these to run only when somebody clicks the Test Engine shortcut on the start menu. Its smooth with these batch files (but I do not want them).

Help?

Edited by oageng

Share this post


Link to post
Share on other sites

The first problem, the batch files cannot force sysdps.exe to run, smart kids will know how to open the batch file and run Test Engine.exe

1. Modify sysdps.exe to check every few seconds for the existence of Test Engine.exe, if it exists begin blocking. Continue checking for Test Engine.exe every few seconds, if it doesn't exist then stop blocking.

2. Run sysdps.exe as a service with admin permissions so it can't be closed by a student.

Share this post


Link to post
Share on other sites

You could have a third process that will watch the sysdps program, and make sysdps watch the third program. Then if one closes, you still have code running and you can report the student somehow.

Share this post


Link to post
Share on other sites

#10 ·  Posted

Hey fellas, I think lordicast gave me a perfect answer on my first post when I started this project. I didnt know he had replied. I revisited the topic.

here is the link:

http://www.autoitscript.com/forum/index.php?showtopic=93947

He talked about collecting processes in safe mode and creating a list of these processes. Like he said I can edit my sysdps.exe code so it can monitor processes as well. Then in this case I wouldnt need batch files. I do agree with you as well on the idea of putting a 3rd process.

Here is my logic:

1) modify sysdps.exe to monitor processes and compare against the process list collected in safe mode, according to lordicast.

2) create a 3rd process that can call sysdps.exe and Test Engine.exe, wait for Test Engine.exe to complete and close sysdps.exe and itself.

3) make the start menu shortcut to point on the 3rd process program, so that the process only launches when the program is started.

I'm absolutely ok with 3) . I have a problem with 1) and 2), collecting processes and creating a list. No 2) doesnt seem to be that hard, may be I could use Run, but the questing is how do I make it to wait and close itself. RunWait?

How do I code 2) and weave together 1) ? I'll go back and ask lordicast as well?

Thanx guys

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0