wolstech Posted November 4, 2006 Posted November 4, 2006 Hi, just a question about how to do something. I have a program (Mcafee AntiSpyware) that runs a service (MASSRV.exe) in the background. It provides realtime protection, which I disabled and do not use. However, the service uses 20MB of RAM to sit there doing nothing, even with realtime off! I can turn it off in services manager, but then the rest of the program, like manual scans, and the main window, will not work or run. What I want to do is make a small script to start the service when i open the software and terminate it when it is closed. I want to rename the main file (MASCon.exe) to some else, like MASCon2.exe, and put my script as MASCon.exe (I have tried renaming and the app will work with the service running.) Then, i want the script (compiled) to start the service, and then run the MASCon2.exe file, wait to finish, then stop the service. I have tried: * Using a RAM optimizer to save memory and leave the service on all the time and wasting memory. * Using a script with the "Run" command (didn't work) - The service will not start by double clicking either. Only via the Services manager in Windows. Thanks.
Uten Posted November 4, 2006 Posted November 4, 2006 Search for +"net start" +"net stop". Run like this Run('net start "<service>"') Sleep(5000) ;Figure out how to know the service is running RunWait("<you appølication>") Run('net stop "<service>"')) Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling
wolstech Posted November 4, 2006 Author Posted November 4, 2006 Thanks for the quick reply! I'll try that out and post back here if it doesn't work...It seems for the find if service is running, i could use a Processexists (something like that) function... Search for +"net start" +"net stop". Run like this Run('net start "<service>"') Sleep(5000) ;Figure out how to know the service is running RunWait("<you appølication>") Run('net stop "<service>"'))
Uten Posted November 4, 2006 Posted November 4, 2006 In the run statement you can add options for monitoring "net start" output. Search for $STDIN_CHILD, $STDOUT_CHILD, $STDERR_CHILD in the forum and you will find plenty of samples. Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now