{"id":26845,"date":"2018-08-09T18:26:00","date_gmt":"2018-08-09T18:26:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/premier_developer\/?p=26845"},"modified":"2019-02-14T20:17:54","modified_gmt":"2019-02-15T03:17:54","slug":"how-to-stop-misbehaving-programs","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/premier-developer\/how-to-stop-misbehaving-programs\/","title":{"rendered":"How to stop misbehaving programs"},"content":{"rendered":"<p>Senior App Dev Manager, <a href=\"https:\/\/www.linkedin.com\/in\/linkai-yu-75111417\/\">Linkai Yu<\/a> shares a little tip to tame a misbehaving process with the help of Gflags.exe.<\/p>\n<hr \/>\n<p>Recently, I encountered a machine experiencing significant performance degradation even after reboots.\u00a0 Using Task Manager, I identified a process that was constantly consuming high amount of CPU.\u00a0 I tried \u201cEnd Task\u201d in Task Manager, but nothing happens.\u00a0 I then tried to uninstall it from Control Panel\/Uninstall Program, but it\u2019s not visible.\u00a0 I also tried to attach a debugger to it but got \u201cAccess Denied\u201d error.<\/p>\n<p>At this point, you could start combing through services, startup apps, and scheduled tasks to see how this process is getting launched in order to disable it, but here\u2019s a trick you might not know: <em>I stopped it with the help of Gflags.<\/em><\/p>\n<p>GFlags (or the Global Flags Editor) enables and disables advanced debugging and troubleshooting features in Windows.\u00a0 You may be familiar with Gflags if you have had to isolate heap corruption issues or spent time developing Windows drivers.\u00a0 It\u2019s also pretty handy to block the start of an application through debugging if it won\u2019t respond any other way.<\/p>\n<p>Here are the steps on how to stop it from bootstrap:<\/p>\n<ul>\n<li>Start Gflags.exe (part of the debugging tools for windows)<\/li>\n<li>Set Image File to the problem app (example: rogue_app.exe)<\/li>\n<li>Select Debugger, type cdb.exe<\/li>\n<li>Click Apply, and then close Gflags.<\/li>\n<\/ul>\n<p>Reboot the machine. This tells the OS to start the program by debugger which actually pauses it as soon as the program is loaded. At that point, shutting down cdb.exe will shut down the problem application. Then you can delete its files.<\/p>\n<p>To undo the setting, simply unselect the debugger check box and click Apply button.<\/p>\n<p>If you want to make sure a certain program does not get to run automatically, you can leave this setting on the machine.<\/p>\n<p><strong>Note of caution<\/strong>: Please make sure you are not setting this on Windows system components or on security components as that could leave your system vulnerable to attacks. This techniques is only for advanced users.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/31\/2019\/04\/gflags.jpg\"><img decoding=\"async\" title=\"gflags\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/31\/2019\/04\/gflags_thumb.jpg\" alt=\"gflags\" width=\"487\" height=\"484\" border=\"0\" \/><\/a><\/p>\n<hr \/>\n<p><a href=\"https:\/\/blogs.msdn.com\/b\/premier_developer\/archive\/2014\/09\/15\/welcome.aspx\"><strong>Premier Support for Developers<\/strong><\/a> provides strategic technology guidance, critical support coverage, and a range of essential services to help teams optimize development lifecycles and improve software quality. Contact your Application Development Manager (ADM) or <a href=\"https:\/\/blogs.msdn.microsoft.com\/premier_developer\/contact-us\/\">email us<\/a> to learn more about what we can do for you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>GFlags (or the Global Flags Editor) enables and disables advanced debugging and troubleshooting features in Windows. You may be familiar with Gflags if you have had to isolate heap corruption issues or spent time developing Windows drivers. It\u2019s also pretty handy to block the start of an application through debugging if it won\u2019t respond any other way.<\/p>\n","protected":false},"author":582,"featured_media":27413,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[118,225,3],"class_list":["post-26845","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-permierdev","tag-debugging","tag-gflags","tag-team"],"acf":[],"blog_post_summary":"<p>GFlags (or the Global Flags Editor) enables and disables advanced debugging and troubleshooting features in Windows. You may be familiar with Gflags if you have had to isolate heap corruption issues or spent time developing Windows drivers. It\u2019s also pretty handy to block the start of an application through debugging if it won\u2019t respond any other way.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/26845","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/users\/582"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/comments?post=26845"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/26845\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media\/27413"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media?parent=26845"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/categories?post=26845"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/tags?post=26845"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}