Submit Your Article Forum Rules

Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31

Thread: Need help with something like batch files trying to shut down M$ Security Essentials

  1. #1
    WebProWorld MVP Clint1's Avatar
    Join Date
    Jun 2003
    Location
    Sitting down in a chair
    Posts
    2,225

    Question Need help with something like batch files trying to shut down M$ Security Essentials

    I'm having a lot of problems trying to do the SIMPLEST thing and I'm hoping someone can put me in the right direction. I have ~a dozen batch files that I use to stop and start various XP Services, with no problem. (For example, there's no point in keeping the Spooler Service running all the time sucking up memory, so I have it set to Manual, then I click the Start batch file before I want to print something, then click its Stop batch file when I finished. Perfect).

    So what's the problem in doing this with Microsoft Security Essentials and its anti-malware service???? First, the idiot program has no way of shutting it down, THAT is the problem! Obviously M$ believes that no one would ever have any reason to close it hence the lack of the simple right click System Tray icon and "Exit" or "Close"! The only way to shut it down is to open the Task Manager and click both "MsMpEng.exe" and "msseces.exe" and "End Process" for each. That just doesn't cut it.

    Using the same batch file method for the SERVICE, MsMpEng.exe, "Microsoft Antimalware Service", DID work, ONCE. But every attempt after that failed with an "Access denied" message showing in the batch file command window! I've tried all of these, all at once and with the last 1 or 2 not there:

    @echo Stopping unnecessary service...
    @net stop Microsoft Antimalware Service
    @net stop MsMpSvc
    @net stop MsMpEng.exe


    Then there's the problem with the app itself, which is NOT a Service, "msseces.exe". I can't find any way to shut it down via batch file.

    However, "taskkill" does work for both of the running items! But it will only work after you click "Run" in the Start Menu and pasted the command line! You have to do it twice:

    taskkill /f /im MsMpEng.exe

    Then:

    taskkill /f /im msseces.exe

    So if that works, then why can't some kind of a one-click shortcut to those complete commands work? Why can't a batch file be created to do both tasks at the same time?

    I read that one can 'allegedly' create a shortcut from the Run command. You can't. When I try and drag the Run icon in the Start Menu (as the webpage states), nothing happens! So I then found the cmd.exe file, and made a shortcut to that. Ok, but now what? Obviously when you click it, the only thing that happens is the cmd prompt window opens up waiting for the command line. How do I automatically POPULATE that line in it; "C:\WINDOWS\system32>", to EXECUTE the command lines I want? I tried modifying the shortcut's properties and that doesn't work:

    C:\WINDOWS\system32\cmd.exe -taskkill /f /im MsMpEng.exe

    ...and several other variants, with and without quotes in various areas, etc.

    So again, can anyone POH-LEEZE tell me how to shut down MSE, BOTH of those running processes, in ONE click? Via batch file, VBS script, Run command shortcut, etc, I don't care. Of course this would NOT be necessary if M$ would have simply added the right click and "Exit" for the System Tray icon.

    Thanks.

  2. #2
    WebProWorld MVP Clint1's Avatar
    Join Date
    Jun 2003
    Location
    Sitting down in a chair
    Posts
    2,225
    Ho boy. This is what happens when you pull your hair out over something, and end up over-complicating it. Seconds after I posted that ^, I realized why not just simply use a shortcut to taskkill??? DUH.

    I created two shortcuts to it, and edited the properties of each to read:

    C:\WINDOWS\system32\taskkill.exe /f /im MsMpEng.exe

    And:

    C:\WINDOWS\system32\taskkill.exe /f /im msseces.exe

    That works fine. So I now I need to find a way to incorporate both of those tasks into one click.

    Now I noticed, that when I click the MSE icon to start it again, it won't start! The app starts, the interface opens up, but the frickin' Service won't start like it used to! You have to click that red button on it "Start Now", even though the Service is set to Automatic!
    Last edited by Clint1; 04-14-2012 at 09:05 AM.

  3. #3
    Moderator SteveGerencser's Avatar
    Join Date
    Jan 2005
    Location
    Small town Tennessee
    Posts
    2,207
    Okay, this won't answer your question, but I will offer some advice to you anyway.

    Don't do this. Windows XP was never designed to allow you to micro manage services like this. Every time you start and stop a service you really should be rebooting your system to make sure everything that is associated with that service, uses that service, or depends on that service, reconnects properly. Add to that, this type of starting/stopping can also introduce other issues to your system depending on which services you are killing and what else is running when you do it.

    Taskkill was designed to terminate a specific task/service that was hanging up your system to allow you to remove it or reboot your system. It was not designed to be an on/off switch to save system resources.

    The obvious answer is add more ram to your system, but I'm going to wager that that isn't an option.

    Steve - former MCSE, CNE, A+, MCT and more. <- 15+ years or real hardware/software tech support
    You can't create artful marketing with color by number seo

  4. The following user agrees with SteveGerencser:
  5. #4
    Administrator weegillis's Avatar
    Join Date
    Oct 2003
    Posts
    5,784
    I would just add, if it was easy to kill an important system protection service, then malware would do it. It makes no sense to be able to reach in, and just kill a program with a simple batch file, especially MSE, or any other anti-malware. Most self-protect services have countermeasures to software manipulation.

    What Steve advises, above, about messing up the system, not rebooting after changing services can result in changes to the registry that are both hard to detect, and that don't get removed or reset even when services are restored. The reboot is not an option, it is a requirement to ensure that the registry is properly updated and backed up.

  6. The Following 2 users agree with weegillis:
  7. #5
    Rest in Peace 1946 - 2013 deepsand's Avatar
    Join Date
    May 2004
    Location
    State College, PA
    Posts
    16,376
    Quote Originally Posted by Clint1 View Post
    The app starts, the interface opens up, but the frickin' Service won't start like it used to! You have to click that red button on it "Start Now", even though the Service is set to Automatic!
    Because "Automatic" means that it's to be automatically started when Windows is launched.

  8. #6
    Administrator weegillis's Avatar
    Join Date
    Oct 2003
    Posts
    5,784
    Furthermore, self-protect services are 'assumed' to be there whence called up. Certain pointers in the registry simply point to locations that are expected to be 'alive', as in point to running services or processes. Shutting down these services while these pointers are in effect can have a negative effect on the hive as a whole, and may make any crash, however remote, unrecoverable.

  9. #7
    WebProWorld MVP Clint1's Avatar
    Join Date
    Jun 2003
    Location
    Sitting down in a chair
    Posts
    2,225
    Quote Originally Posted by SteveGerencser View Post
    Okay, this won't answer your question, but I will offer some advice to you anyway.

    Don't do this. Windows XP was never designed to allow you to micro manage services like this. Every time you start and stop a service you really should be rebooting your system to make sure everything that is associated with that service, uses that service, or depends on that service, reconnects properly. Add to that, this type of starting/stopping can also introduce other issues to your system depending on which services you are killing and what else is running when you do it.
    Of that I am fully aware, I didn't just start using PC's yesterday. Trying to close an anti-malware program--which as I said--can be done with any other anti malware program via the System Tray icon--is not "micro managing" anything. We are NOT talking about shutting down RPC, or Windows Management Instrumentation, etc., nor any other critical XP Service! We are talking about an anti-malware program......that (like all the others) not only has no business running in the background when one is trying to install or uninstall software, (and most installers even tell you to shut down this type of software while installing their programs), cannot be running when something like defrag'ing is done, but does not even need to be running and sucks up memory and resources when one is working with A/V creation and editing, and the like!

    Since you want this to be about Services (and "micro-managing") : Windows Image Acquisition, the Print Spooler, and more than a dozen others, are nothing but resource and memory hogs that add up to a lot of wasted memory and resources! Such services of which I speak are NOT "mission critical" Services. Furthermore, they have no critical lower-tier dependencies ("associated with that service"). Keeping them on Manual does not affect any other (mandatory) Service. Otherwise, my PC would not properly work. (http://www.blackviper.com/windows-de...ault-services/ , example: http://www.blackviper.com/windows-se...print-spooler/ : "I place this service into manual mode and only start it up when printing is required. In manual mode, the service will not automatically start at boot time. However, if you do a lot of printing, Automatic is the best bet for convenience.")

    As I said, I have been doing this since shorty after XP came out, and, with absolutely no ill-effects.


    Taskkill was designed to terminate a specific task/service that was hanging up your system to allow you to remove it or reboot your system. It was not designed to be an on/off switch to save system resources.
    That's why I need a batch file to do it! But since people unwilling to help with that........


    The obvious answer is add more ram to your system, but I'm going to wager that that isn't an option.
    It already has the max amount of RAM seen by XP. (4gb, sees about 3.3gb, 3.4ghz overclocked CPU).

    So your "advice" is to: spend ~$1000+ for a new PC and OS that will allow 8gb+ of RAM, and "micro managing", with a currently non-existing 6ghz CPU, just to shut down a frickin' anti-malware program that should have an "Exit" command just like all the others??

    This is not about Services, this is not about criticizing how one uses, and chooses to use their PC, nor how one has been using their PC since shortly after the OS was released. This is simply about how to create a batch file (or similar), to shut down a frickin' program that has no business running at specific times. But due to the fact that everyone wants to turn this into something it is not, obviously I'll need to go elsewhere for assistance. Which is precisely what you wanted since you have been most vocally opposed to a Software forum.

    Thanks for the "help". Everyone.
    Last edited by Clint1; 04-15-2012 at 05:45 AM.

  10. #8
    WebProWorld MVP Clint1's Avatar
    Join Date
    Jun 2003
    Location
    Sitting down in a chair
    Posts
    2,225
    Quote Originally Posted by deepsand View Post
    Because "Automatic" means that it's to be automatically started when Windows is launched.
    No....not necessarily. http://www.webproworld.com/webmaster...l=1#post612009 MSE will not load at startup for many people, even with it of course set to Automatic.

  11. #9
    WebProWorld MVP Clint1's Avatar
    Join Date
    Jun 2003
    Location
    Sitting down in a chair
    Posts
    2,225
    Since I like to help others when I can, if anyone else has a similar situation this is what I've done so far:

    So far the only way I've found to stop "MsMpEng.exe" and "msseces.exe" (so I can successfully defragment, install/uninstall apps, video creation/editing, and RAM & resource intensive tasks, etc.), is to create two taskkill shortcuts; one for each. In the shortcut "Target" properties for each, are these:

    1st: C:\WINDOWS\system32\taskkill.exe /f /im msseces.exe
    2nd: C:\WINDOWS\system32\taskkill.exe /f /im MsMpEng.exe

    They need to be clicked in that order or an MSE pop-up will appear.

    *I have not yet found a way to incorporate both commands into one click.

    Then to start MSE again when I need it, I changed the properties of the MSE app shortcut to point to a batch file:

    @title MSE Manager
    @echo Running MsMpSvc... Wait until it's done.
    net start MsMpSvc
    "C:\Program Files\Microsoft Security Client\msseces.exe"
    @echo Stopping unnecessary service...
    @net stop MsMpSvc


    Or:

    @title MSE Manager
    @echo Running MsMpSvc... Wait until it's done.
    net start MsMpSvc
    "C:\Program Files\Microsoft Security Client\msseces.exe"


    It starts again as before, the icon goes to the System Tray, but either way, *unlike all the other batch files I use in the exact same manner, the command window will not automatically close like the others! So I have to click to close it, and click to close the MSE main program window.

    To change the shortcut icon for the new MSE shortcut back to the MSE icon, you click its Properties > Change icon > then browse to the MSE folder and select msseces.exe . To do the same thing for the taskkill shortcuts, I created a new icon using the default MSE icon but with a red X through it, and used those for both of the shortcuts, put those on the Quick Launch toolbar next to the MSE app (MSE batch file) icon.

    No, your PC will not explode, implode, melt-down, nor become unstable in any way. As a matter of fact, it will be MORE STABLE when you do your resource and CPU-intensive tasks, defrag'ing, etc., because it will not be running and interfering with said tasks.

    *If someone could assist with those areas, I'd appreciate it. But I won't hold my breath looking at the way this thread has gone so far.

  12. #10
    WebProWorld MVP DaveSawers's Avatar
    Join Date
    Dec 2006
    Location
    Lunenburg, Nova Scotia, Canada
    Posts
    704
    Maybe I missed something in all the noise in this thread, but why can't you point your shutdown shortcut to a batch file that executes the two commands in order?
    Dynamic Software Development
    Hidden Content

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •