{"id":6072,"date":"2021-11-18T00:15:19","date_gmt":"2021-11-18T00:15:19","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=6072"},"modified":"2021-11-18T00:16:01","modified_gmt":"2021-11-18T00:16:01","slug":"solved-how-to-batch-antivirus-and-cleaning-script-automation","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/programming\/how-to-batch-antivirus-and-cleaning-script-automation\/29813.html","title":{"rendered":"Solved How To BATCH ANTIVIRUS And CLEANING SCRIPT AUTOMATION"},"content":{"rendered":"<p>I have spent several Days writing my new Batch cleaning script with the aim to help some<br \/>\nfriends of mine who run Windows Vista who are always getting bogged down with clutter and<br \/>\nvirus&#8217;s, times are getting tough for people these days so decided to give it a go.<\/p>\n<p>This should work on Windows 7 or 8 it is UNTESTED on win 7 or 8 so use at own risk, I would<br \/>\nbe Interested in others who would like to try it out and send me some feedback ?<\/p>\n<p>My question is can people verify if this works ok on other windows operating systems, the<br \/>\nreason I ask is I want my script which is a bit of block code from several other sources I found online which I combined and adapted to the needs of my friends, and of coarse myself.<\/p>\n<p>It is purely an Automation Script which I designed to be flexible in various situations, so that it<br \/>\ncould run some portable applications as well just in case people do not want to install anything<br \/>\nextra on their machines, for example it runs MBAR the portable MalwareBytes RootKit Removal<br \/>\ntool, but you will have to place that in the Mbar folder below this batch files path for that to work.<\/p>\n<p>My batch file ALSO uses some system optimization tools from SYSINTERNALS if you do not<br \/>\nhave these tools installed my batch should just skip by them, I am curious as to how well it<br \/>\nworks on other versions of windows but I am limited to XP and Vista here.<\/p>\n<p>Thanks Michelle<\/p>\n<p>:: Beginning of Batch Cleaning Script<\/p>\n<p>@echo off<br \/>\ngoto nodebug<\/p>\n<p>:: @@@@@ Below Block is for Debugging Purposes Only @@@@@<br \/>\n@echo on<br \/>\necho ERROR TEST LOG FLAG<br \/>\nIF NOT %1!==\/go! %0 \/go 1&gt;C:\\state\\%~n0.log 2&gt;&amp;1<br \/>\nSHIFT<\/p>\n<p>ECHO %1 %2 %3 %4 %5<\/p>\n<p>:: @@@@@ Above Block is for Debugging Purposes Only @@@@@@<br \/>\n:nodebug<br \/>\n:: :::::::::::::::::::::::::::::::::::::::<br \/>\n:: Automatically check &amp; get admin rights<br \/>\n:: :::::::::::::::::::::::::::::::::::::::<br \/>\n:: <a href=\"https:\/\/web.archive.org\/web\/20161127062548\/http:\/\/stackoverflow.com\/questions\/7044985\/how-can-i-auto-elevate-my-batch-file-so-that-it-requests-from-uac-admin-rights\" target=\"_blank\" rel=\"nofollow noopener\">http:\/\/stackoverflow.com\/questions\/&#8230;<\/a><br \/>\necho Hello Computer Name: %computername%<br \/>\necho.<br \/>\nECHO.<br \/>\nECHO =============================<br \/>\nECHO Running Admin shell<br \/>\nECHO =============================<\/p>\n<p>:checkPrivileges<br \/>\nNET FILE 1&gt;NUL 2&gt;NUL<br \/>\nif &#8216;%errorlevel%&#8217; == &#8216;0&#8217; ( goto gotPrivileges ) else ( goto getPrivileges )<\/p>\n<p>:getPrivileges<br \/>\nif &#8216;%1&#8217;==&#8217;ELEV&#8217; (shift &amp; goto gotPrivileges)<br \/>\nECHO.<br \/>\nECHO **************************************<br \/>\nECHO Invoking UAC for Privilege Escalation<br \/>\nECHO **************************************<br \/>\nsetlocal DisableDelayedExpansion<br \/>\nset &#8220;batchPath=%~0&#8221;<br \/>\nsetlocal EnableDelayedExpansion<br \/>\nECHO Set UAC = CreateObject^(&#8220;Shell.Application&#8221;^) &gt; &#8220;%temp%\\OEgetPrivileges.vbs&#8221;<br \/>\nECHO UAC.ShellExecute &#8220;!batchPath!&#8221;, &#8220;ELEV&#8221;, &#8220;&#8221;, &#8220;runas&#8221;, 1 &gt;&gt; &#8220;%temp%\\OEgetPrivileges.vbs&#8221;<br \/>\n&#8220;%temp%\\OEgetPrivileges.vbs&#8221;<br \/>\nexit \/B<\/p>\n<p>echo Current path is %cd%<br \/>\necho Changing directory to the path of the current script<br \/>\ncd %~dp0<br \/>\necho Current path is %cd%<\/p>\n<p>:gotPrivileges<br \/>\n::::::::::::::::::::::::::::<br \/>\n::START<br \/>\n:: @@@@@@@@@@@@ DEEP OR QUICK MODE SELECTION BELOW @@@@@@@@@@@@<br \/>\n@For \/F &#8220;tokens=1,2,3,4 delims=\/ &#8221; %%A in (&#8216;Date \/t&#8217;) do @(<br \/>\nSet Day=%%A<br \/>\nSet Month=%%B<br \/>\nSet Year=%%C<br \/>\n)<\/p>\n<p>echo &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\necho %Year%-%Month%-%Day%<br \/>\necho.<br \/>\nset choice=n<br \/>\necho &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\necho Do you want to RUN Manual Deep Scans ALSO ? Press: y : then : ENTER.<br \/>\necho.<br \/>\necho NOTE: Some of these deep scans can take a long time to complete &#8230;<br \/>\necho You should only run the DEEP scans about once a month to save time&#8230;<br \/>\necho OR If you KNOW their is a problem with your computer and it needs fixing.<br \/>\necho.<br \/>\necho If you Want FULL Automation and DO NOT want to<br \/>\necho be bothered with DEEP Manual Scans JUST Press Enter.<br \/>\necho &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nset \/P choice=: [y] or [n] ^&gt;<br \/>\necho.<br \/>\necho You Pressed The: %choice% Key<br \/>\n:: Check and MAKE SURE an Invalid Key was not pressed if so set n<br \/>\nif not %choice%==y if not %choice%==n set choice=n<br \/>\necho.<br \/>\n:: @@@@@@@@@@@@ DEEP OR QUICK MODE SELECTION ABOVE @@@@@@@@@@@@<br \/>\n:: The User Selection Options y or n are taken into consideration<br \/>\n:: further down the script in various selected regions.<br \/>\n:: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n:: This Sets a TIME SLOT of FULL scan mode on EMSISOFT if ALL true<br \/>\nif %choice%==y (set scanmode=deep) else (set scanmode=smart)<br \/>\necho &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\necho This AUTOMATED batch cleaning tool was written by Chelley<br \/>\necho It can ONLY work if you have several programs Installed<br \/>\necho Including SPYBOT SEARCH AND DESTROY. Including the Following !<br \/>\necho Malwarebytes : Emsisoft : Defraggler : CCleaner :<br \/>\necho IF some or ALL of these programs are missing or not Installed<br \/>\necho in their USUAL C:\\Program Files Location then this Batch<br \/>\necho file MAY not be effective in AUTOCLEANING your system,<br \/>\necho if you have any problems please contact Chelley<br \/>\necho.<br \/>\necho THIS BATCH MUST BE STARTED VIA RUNNING: RUNME.bat AS an ADMINISTRATOR<br \/>\necho &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\npathping 127.0.0.1 -n -q 1 -p 5000 &gt;nul 2&gt;&amp;1<br \/>\nif not exist &#8220;%SystemRoot%\\System32\\Contig.exe&#8221; if exist &#8220;Contig.exe&#8221; xcopy \/y Contig.exe &#8220;%SystemRoot%\\System32\\Contig.exe&#8221;<br \/>\ncls<br \/>\n:: ###########################################################<br \/>\n&gt; cleaning.tmp echo Running<br \/>\nset state=&#8221;C:\\state\\clnstate.txt&#8221;<br \/>\nif not exist C:\\state\\ md C:\\state\\<br \/>\n&gt;&gt; %state% echo.<br \/>\n&gt;&gt; %state% echo STARTING NEW SCAN ON Time: %time% Date: %date%<br \/>\n&gt;&gt; %state% echo &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n:: <a href=\"https:\/\/web.archive.org\/web\/20161127062548\/http:\/\/www.makeuseof.com\/tag\/xx-ways-clean-computer-automated-script\/\" target=\"_blank\" rel=\"nofollow noopener\">http:\/\/www.makeuseof.com\/tag\/xx-way&#8230;<\/a><br \/>\n:: ###########################################################<br \/>\n:: <a href=\"https:\/\/web.archive.org\/web\/20161127062548\/https:\/\/helpdesk.malwarebytes.org\/hc\/en-us\/articles\/202325528-How-do-I-use-Malwarebytes-Chameleon-to-run-Malwarebytes-Anti-Malware-on-an-infected-system-\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/helpdesk.malwarebytes.org\/h&#8230;<\/a><br \/>\nif exist &#8220;C:\\Program Files\\Malwarebytes Anti-Malware\\mbam.exe&#8221; (set mbytes=11) else (set mbytes=10)<br \/>\nif exist &#8220;C:\\Program Files\\Malwarebytes Anti-Malware\\mbam.exe&#8221; (set mbaU=&#8221;C:\\Program Files\\Malwarebytes Anti-Malware\\mbam.exe&#8221; \/runupdate) else (set mbaU=&gt;&gt; %state% echo Malware Bytes is Not Installed or path LOCATION ERROR on %date%)<br \/>\nif exist &#8220;C:\\Program Files\\Malwarebytes Anti-Malware\\mbam.exe&#8221; (set mbaS=&#8221;C:\\Program Files\\Malwarebytes Anti-Malware\\mbam.exe&#8221; \/fullauto) else (set mbaS=echo none)<br \/>\nif exist &#8220;C:\\Program Files\\Defraggler\\df.exe&#8221; (set def=&#8221;C:\\Program Files\\Defraggler\\df&#8221;) else (set def=%SystemRoot%\\system32\\Defrag)<br \/>\nif exist &#8220;C:\\Program Files\\CCleaner\\CCleaner.exe&#8221; (set cc=1) else (set cc=10)<br \/>\nif exist &#8220;C:\\Program Files\\CCleaner\\CCleaner.exe&#8221; (set ccscf=&#8221;C:\\Program Files\\CCleaner\\CCleaner.exe&#8221; \/AUTO) else (set ccscf=&gt;&gt; %state% echo CCleaner is Not Installed or path LOCATION ERROR on %date%)<br \/>\nif exist &#8220;C:\\Program Files\\CCleaner\\CCleaner.exe&#8221; (set ccscr=&#8221;C:\\Program Files\\CCleaner\\CCleaner.exe&#8221; \/REGISTRY \/AUTO) else (set ccscr=echo none)<br \/>\nif exist &#8220;C:\\Program Files\\Spybot &#8211; Search &amp; Destroy\\SpybotSD.exe&#8221; (set spb=1) else (set spb=10)<br \/>\nif exist &#8220;C:\\Program Files\\Spybot &#8211; Search &amp; Destroy\\SpybotSD.exe&#8221; (set spybot1=&#8221;C:\\Program Files\\Spybot &#8211; Search &amp; Destroy\\SpybotSD.exe&#8221; \/autoupdate \/autoimmunize \/autocheck \/autofix \/autoclose) else (set spybot1=&gt;&gt; %state% echo Spybot Search and Destroy is Not Installed or path LOCATION ERROR on %date%)<br \/>\nif exist &#8220;C:\\Program Files\\Emsisoft Anti-Malware\\a2cmd.exe&#8221; (set a2c=1) else (set a2c=10)<br \/>\nif exist &#8220;C:\\Program Files\\Emsisoft Anti-Malware\\a2cmd.exe&#8221; (set amalu=&#8221;C:\\Program Files\\Emsisoft Anti-Malware\\a2cmd.exe&#8221; \/s \/update &amp;&amp;echo; UPDATED Emsisoft &amp;&amp;if; exist sleep.com sleep 5) else (set amalu=&gt;&gt; %state% echo Emsisoft Antimalware is Not Installed or path LOCATION ERROR on %date%)<br \/>\nif exist &#8220;C:\\Program Files\\Emsisoft Anti-Malware\\a2cmd.exe&#8221; (set amals=&#8221;C:\\Program Files\\Emsisoft Anti-Malware\\a2cmd.exe&#8221; \/s \/%scanmode% \/h \/m \/t \/r \/d \/whitelist=&#8221;C:\\Program Files\\Emsisoft Anti-Malware\\a2whitelist.ini&#8221; \/quarantine=&#8221;C:\\Program Files\\Emsisoft Anti-Malware\\Quarantine&#8221; \/delete) else (set amals=echo none)<br \/>\nif %mbytes%==11 echo Updating MalwareBytes &amp;&amp;%mbaU%<br \/>\n:: <a href=\"https:\/\/web.archive.org\/web\/20161127062548\/http:\/\/www.safer-networking.org\/faq\/are-there-any-command-line-parameters-that-can-be-used-with-spybot-sd\/\" target=\"_blank\" rel=\"nofollow noopener\">http:\/\/www.safer-networking.org\/faq&#8230;<\/a><br \/>\n:: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@<br \/>\n:: SPYBOT SEARCH AND DESTROY LOG SNOOPING LOOKING FOR SPYWARE START<br \/>\n:: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\nif exist &#8220;%ALLUSERSPROFILE%\\Application Data\\Spybot &#8211; Search &amp; Destroy\\Logs&#8221; set splogs=&#8221;%ALLUSERSPROFILE%\\Application Data\\Spybot &#8211; Search &amp; Destroy\\Logs\\Checks.*%Month%%Day%-*.log&#8221;<br \/>\nset spiesfound=0<br \/>\nif exist %splogs% (goto check1a) else (goto nochk1a)<br \/>\n:check1a<br \/>\n&gt;nul find &#8220;found:&#8221; %splogs% &amp;&amp; (<br \/>\necho Spybot has found Spyware on %computername%.<br \/>\nset spiesfound=1<br \/>\ngoto :notice2<br \/>\n) || (<br \/>\necho Spybot has found no Spyware on %computername%.<br \/>\ngoto :nofix2<br \/>\n)<\/p>\n<p>if %spiesfound%==1 echo SPYWARE WAS FOUND BY SPYBOT SEARCH AND DESTROY.<br \/>\nif %spiesfound%==1 &gt;&gt; %state% echo SPYWARE WAS FOUND BY SPYBOT SEARCH AND DESTROY T:%time D:%date%<br \/>\n:nochk1a<br \/>\n:: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@<br \/>\n:: SPYBOT SEARCH AND DESTROY LOG SNOOPING LOOKING FOR SPYWARE END<br \/>\n:: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@<br \/>\n&gt;&gt; %state% echo Operating System = Windows %os%<br \/>\n&gt;&gt; %state% echo &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n&gt;&gt; %state% echo.<br \/>\n&gt;&gt; %state% echo NEW SCAN INITIALIZED FOR CLEANING AND DEFRAG AT %time% on %date%<br \/>\nif %a2c%==10 &gt;&gt; %state% echo Emsisoft Antimalware Is Missing Please Instal <a href=\"https:\/\/web.archive.org\/web\/20161127062548\/http:\/\/tinyurl.com\/knd5aod\" target=\"_blank\" rel=\"nofollow noopener\">http:\/\/tinyurl.com\/knd5aod<\/a><br \/>\nif %mbytes%==10 &gt;&gt; %state% echo MalwareBytes is Not Installed Will try Portable Version OR Please Install from <a href=\"https:\/\/web.archive.org\/web\/20161127062548\/https:\/\/www.malwarebytes.org\/\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/www.malwarebytes.org\/<\/a><br \/>\nif %cc%==10 &gt;&gt; %state% echo Ccleaner is Missing Please Install <a href=\"https:\/\/web.archive.org\/web\/20161127062548\/http:\/\/www.piriform.com\/\" target=\"_blank\" rel=\"nofollow noopener\">http:\/\/www.piriform.com\/<\/a><br \/>\nif %spb%==10 &gt;&gt; %state% echo Spybot Search and Destroy is Missing Please Install <a href=\"https:\/\/web.archive.org\/web\/20161127062548\/http:\/\/www.safer-networking.org\/\" target=\"_blank\" rel=\"nofollow noopener\">http:\/\/www.safer-networking.org\/<\/a><br \/>\nif %Day%==8 Cleanmgr \/sagerun:1<br \/>\nif %Day%==22 Cleanmgr \/sagerun:1<br \/>\n:: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@<br \/>\ncls<br \/>\n:: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n&gt;&gt; %state% echo CLEANING YOUR SYSTEM T: %time% D: %date%<br \/>\nif %a2c%==1 echo Updating Emsisoft &amp;&amp;%amalu%<br \/>\necho.&amp;&amp;cls;<br \/>\necho DONE Emsisoft Update<br \/>\npathping 127.0.0.1 -n -q 1 -p 5000 &gt;nul 2&gt;&amp;1<br \/>\ncls<br \/>\n:: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\nif %cc%==1 echo Running Ccleaner File Clean &amp;&amp;%ccscf%<br \/>\necho.&amp;&amp;cls;<br \/>\nif %cc%==1 echo DONE Ccleaner File Clean<br \/>\npathping 127.0.0.1 -n -q 1 -p 5000 &gt;nul 2&gt;&amp;1<br \/>\ncls<br \/>\n:: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\nif %cc%==1 echo Running Ccleaner Reg Clean &amp;&amp;%ccscr%<br \/>\necho.&amp;&amp;cls;<br \/>\nif %cc%==1 echo DONE Ccleaner Registry Clean<br \/>\npathping 127.0.0.1 -n -q 1 -p 5000 &gt;nul 2&gt;&amp;1<br \/>\ncls<br \/>\nif %choice%==n goto donesbsd<br \/>\nif %spb%==10 goto donesbsd<br \/>\n:: &#8212;&#8212;&#8212;- Prevents Repeat Checks Same Month &#8212;&#8212;&#8212;<br \/>\nset noloop2=0<br \/>\nif exist Month2.tmp set \/p noloop2=&lt;Month2.tmp<br \/>\nif %noloop2% NEQ %Month% goto spsdr<br \/>\nif %noloop2% EQU %Month% echo SPYBOT Search 8 Destroy HAS ALREADY RUN ONCE THIS Month<br \/>\nif %noloop2% EQU %Month% &gt;&gt; %state% echo SPYBOT Search 8 Destroy HAS ALREADY RUN ONCE THIS Month %Month%<br \/>\npathping 127.0.0.1 -n -q 1 -p 5000 &gt;nul 2&gt;&amp;1<br \/>\nif %noloop2%==%Month% goto donesbsd<br \/>\n:: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n:spsdr<br \/>\n&gt; Month2.tmp echo %Month%<br \/>\nif %choice%==y echo Running Spybot Search and Destroy Please Wait &#8230; &amp;&amp;%spybot1%<br \/>\necho.&amp;&amp;cls;<br \/>\nif %choice%==y echo DONE Spybot Search and Destroy Scan &amp;&amp;goto; donesbsd<br \/>\ncls<br \/>\n:: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\nif %Day%==21 echo Running Spybot Search and Destroy &amp;&amp;%spybot1%<br \/>\nif %Day%==21 echo DONE Spybot Search and Destroy Scan<br \/>\n:donesbsd<br \/>\npathping 127.0.0.1 -n -q 1 -p 5000 &gt;nul 2&gt;&amp;1<br \/>\ncls<br \/>\n:: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\nif %mbytes%==11 if %choice%==y echo Running MalwareBytes Antimalware &amp;&amp;%mbaS%<br \/>\necho.&amp;&amp;cls;<br \/>\nif %mbytes%==11 if %choice%==y echo Done MalwareBytes Antimalware<br \/>\npathping 127.0.0.1 -n -q 1 -p 5000 &gt;nul 2&gt;&amp;1<br \/>\ncls<br \/>\n:: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\nif %a2c%==1 echo Emsisoft Antimalware Scanning &amp;&amp;%amals%<br \/>\necho.&amp;&amp;cls;<br \/>\nif %a2c%==1 echo Completed Emsisoft Antimalware Scan.<br \/>\npathping 127.0.0.1 -n -q 1 -p 5000 &gt;nul 2&gt;&amp;1<br \/>\ncls<br \/>\nset malfound=0<br \/>\n:: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@<br \/>\n:: @@@@@@@@@@@@@@@@@@@@ OPTIONAL @@@@@@@@@@@@@@@@@@@@@@@@<br \/>\n:: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n:: If in &#8220;mbar-log-*.txt&#8221; a &#8220;Removal queue found&#8221; or &#8220;Cleaning up&#8221; or &#8220;Infected&#8221; then run fixdamage<br \/>\nif exist Mbar\\mbar.exe (goto mbar1) else (goto nofix)<br \/>\n:mbar1<br \/>\n:: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\necho.<br \/>\necho.<br \/>\n:: If all the scanners did a DEEP scan all at once it could take 24 Hours<br \/>\n:: to complete so these Variables below check to ensure only one scanner at<br \/>\n:: a time gets to run in deep scan mode to save time.<br \/>\n:: also if Malwarebytes is already installed skip portable MBAR version.<br \/>\n:: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nif %mbytes%==11 goto nocheck1<br \/>\nif %scanmode%==deep goto nocheck1<br \/>\nif %choice%==n goto nocheck1<br \/>\necho &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\necho PLEASE LEAVE THIS WINDOW OPEN or BEHIND an Active Scan Window<br \/>\necho as you may have to read further scan results or Input [y] or [n]<br \/>\necho.<br \/>\necho STARTING PORTABLE VERSION OF MALWAREBYTES MBAR<br \/>\necho Starting Mbar Scanner Please Wait &#8230;.<br \/>\necho.<br \/>\nif exist Mbar\\mbar.exe call Mbar\\mbar.exe<br \/>\npathping 127.0.0.1 -n -q 1 -p 5000 &gt;nul 2&gt;&amp;1<br \/>\ncd %1<br \/>\ncls<br \/>\nif exist &#8220;Mbar\\Plugins\\fixdamage.exe&#8221; (goto fixdamage) else (goto nofix)<\/p>\n<p>echo &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n:fixdamage<br \/>\necho PRESS PAUSE BREAK KEY TO READ TEXT BELOW : PRESS SPACE BAR TO CONTINUE<br \/>\necho.<br \/>\necho &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nif exist Mbar\\mbar-log-%year%-%Month%-%Day%*.txt (goto :check1) else (goto :nocheck1)<br \/>\n:check1<br \/>\n&gt;nul find &#8220;Infected&#8221; Mbar\\mbar-log-%year%-%Month%-%Day%*.txt &amp;&amp; (<br \/>\necho MBAR has found A Virus on %computername%.<br \/>\nset malfound=1<br \/>\ngoto :notice<br \/>\n) || (<br \/>\necho Mbar has found no Infection on %computername%.<br \/>\ngoto :nofix<br \/>\n)<\/p>\n<p>:: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@<br \/>\n:notice<br \/>\necho.<br \/>\necho Selecting fixdamage will open another console window and request<br \/>\necho confirmation to apply any fixes to %computername%. Input: Y<br \/>\necho to begin the fix.<br \/>\necho.<br \/>\n:nocheck1<br \/>\necho IMPORTANT If MBAR should ever find an Infection on %computername%<br \/>\necho You MUST Run the FIX DAMAGE application to repair any Damage<br \/>\necho A Virus \/ Trojan Horse \/ or other Malware may have caused.<br \/>\necho.<br \/>\necho However PLEASE NOTE that Running FIXDAMAGE.EXE Unnecesarily<br \/>\necho may result in losing some user settings, these are not critical but<br \/>\necho will mean you may have to reconfigure some user preferences again.<br \/>\necho.<br \/>\necho.<br \/>\n:nofix<br \/>\npathping 127.0.0.1 -n -q 1 -p 15000 &gt;nul 2&gt;&amp;1<br \/>\n:: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@<br \/>\necho.<br \/>\nif %spiesfound%==1 if %malfound%==1 echo Multiple Problems were found on your computer Virus&#8217;s and Spyware<br \/>\necho.<br \/>\n:: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n&gt;&gt; %state% echo.<br \/>\nif %spiesfound%==1 if %malfound%==1 &gt;&gt; %state% echo Multiple Problems were found on your computer Virus&#8217;s and Spyware<br \/>\n&gt;&gt; %state% echo.<br \/>\n:: @@@@@@@@@@@@@@@@@@@@ OPTIONAL @@@@@@@@@@@@@@@@@@@@@@@@<br \/>\n:: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@<br \/>\necho Now Defragmenting YOUR HARD DRIVE<br \/>\n&gt;&gt; %state% echo DEFRAGMENTING YOUR SYSTEM T: %time% D: %date%<br \/>\n%def% C:<br \/>\n:: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@<br \/>\nif exist &#8220;D:\\&#8221;* (set drvexist01=1) else (set drvexist01=0)<br \/>\nif exist &#8220;E:\\&#8221;* (set drvexist02=1) else (set drvexist02=0)<br \/>\nif exist &#8220;F:\\&#8221;* (set drvexist03=1) else (set drvexist03=0)<br \/>\nif exist &#8220;G:\\&#8221;* (set drvexist04=1) else (set drvexist04=0)<br \/>\n:: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@<br \/>\n:: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nif &#8220;%drvexist01%&#8221;==&#8221;0&#8221; goto noD<br \/>\necho.<br \/>\necho Now Checking Defrag Schedule for D: Drive<br \/>\necho.<br \/>\nif %Day%==2 %def% D:<br \/>\nif %Day%==5 %def% D:<br \/>\nif %Day%==10 %def% D:<br \/>\nif %Day%==28 %def% D:<br \/>\n:: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n:noD<br \/>\nif &#8220;%drvexist02%&#8221;==&#8221;0&#8221; goto noE<br \/>\necho.<br \/>\necho Now Checking Defrag Schedule for E: Drive<br \/>\necho.<br \/>\nif %Day%==3 %def% E:<br \/>\nif %Day%==12 %def% E:<br \/>\n:: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n:noE<br \/>\nif &#8220;%drvexist03%&#8221;==&#8221;0&#8221; goto noF<br \/>\necho.<br \/>\necho Now Checking Defrag Schedule for F: Drive<br \/>\necho.<br \/>\nif %Day%==4 %def% F:<br \/>\nif %Day%==26 %def% F:<br \/>\n:: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n:noF<br \/>\nif &#8220;%drvexist03%&#8221;==&#8221;0&#8221; goto noG<br \/>\necho.<br \/>\necho Now Checking Defrag Schedule for G: Drive<br \/>\necho.<br \/>\nif %Day%==25 %def% G:<br \/>\n:: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n:noG<br \/>\n:: @@@@@@@@@@@@@@@@@<br \/>\n:: CHECK DISK FOR ERRORS chkdsk<br \/>\nif %Day% GTR 25 if %Day% LSS 27 goto chk<br \/>\nif %Day% GTR 10 if %Day% LSS 14 goto chk<br \/>\nif %Day% LSS 03 goto chk<br \/>\ngoto nochk<br \/>\n:chk<br \/>\nset noloop1=0<br \/>\nif exist today1.tmp set \/p noloop1=&lt;today1.tmp<br \/>\nif %noloop1%==%Day% echo HARD DISKS HAVE ALREADY BEEN CHECKED ONCE TODAY<br \/>\n&gt;&gt; %state% echo HARD DISKS HAVE ALREADY BEEN CHECKED ONCE TODAY %date%<br \/>\nif %noloop1%==%Day% goto nochk<br \/>\n&gt; today1.tmp echo %Day%<br \/>\n&gt;&gt; %state% echo Now CHECKING YOUR HARD DRIVE<br \/>\necho Now CHECKING YOUR HARD DRIVE<br \/>\necho y &gt; confirm.txt<br \/>\npathping 127.0.0.1 -n -q 1 -p 5000 &gt;nul 2&gt;&amp;1<br \/>\n:: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nif &#8220;%drvexist01%&#8221;==&#8221;0&#8221; goto noD1<br \/>\necho Checking Drive D: For Errors<br \/>\necho.<br \/>\ncls<br \/>\n&gt;&gt; %state% echo Checking Drive D: For Errors<br \/>\n&gt;&gt; %state% echo.<br \/>\nchkdsk D: \/F &lt; confirm.txt<br \/>\npathping 127.0.0.1 -n -q 1 -p 5000 &gt;nul 2&gt;&amp;1<br \/>\n:noD1<\/p>\n<p>if &#8220;%drvexist02%&#8221;==&#8221;0&#8221; goto noE1<br \/>\necho Checking Drive E: For Errors<br \/>\necho.<br \/>\ncls<br \/>\n&gt;&gt; %state% echo Checking Drive E: For Errors<br \/>\n&gt;&gt; %state% echo.<br \/>\nchkdsk E: \/F &lt; confirm.txt<br \/>\npathping 127.0.0.1 -n -q 1 -p 5000 &gt;nul 2&gt;&amp;1<br \/>\n:noE1<\/p>\n<p>:: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nif &#8220;%drvexist03%&#8221;==&#8221;0&#8221; goto noF1<br \/>\necho Checking Drive F: For Errors<br \/>\necho.<br \/>\ncls<br \/>\n&gt;&gt; %state% echo Checking Drive F: For Errors<br \/>\n&gt;&gt; %state% echo.<br \/>\nchkdsk F: \/F &lt; confirm.txt<br \/>\npathping 127.0.0.1 -n -q 1 -p 5000 &gt;nul 2&gt;&amp;1<br \/>\n:noF1<\/p>\n<p>:: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nif &#8220;%drvexist04%&#8221;==&#8221;0&#8221; goto noG1<br \/>\necho Checking Drive G: For Errors<br \/>\necho.<br \/>\ncls<br \/>\n&gt;&gt; %state% echo Checking Drive G: For Errors<br \/>\n&gt;&gt; %state% echo.<br \/>\nchkdsk G: \/F &lt; confirm.txt<br \/>\npathping 127.0.0.1 -n -q 1 -p 5000 &gt;nul 2&gt;&amp;1<br \/>\n:noG1<\/p>\n<p>:: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@<br \/>\necho Checking Drive C: For Errors<br \/>\necho.<br \/>\n&gt;&gt; %state% echo Checking Drive C: For Errors<br \/>\n&gt;&gt; %state% echo.<br \/>\nchkdsk C: \/F &lt; confirm.txt<br \/>\npathping 127.0.0.1 -n -q 1 -p 5000 &gt;nul 2&gt;&amp;1<br \/>\n:: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@<br \/>\n:nochk<br \/>\nif %malfound%==0 goto nomrt<br \/>\necho BECAUSE A VIRUS WAS DETECTED A FULL MICROSOFT<br \/>\necho M.R.T. MUST BE RUN this Can take some time,<br \/>\necho IT SHOULD BE ALLOWED TO BE COMPLETED.<br \/>\n:nomrt<br \/>\nif %spiesfound%==1 if %malfound%==1 goto malrem<br \/>\nif %choice%==n goto nomalrem<br \/>\n:: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@<br \/>\nif exist &#8220;malremove.exe&#8221; goto malrem<br \/>\ngoto nomalrem<br \/>\n:malrem<br \/>\necho Running Microsoft Malacious Software Removal Tool Time: %time%<br \/>\n&gt;&gt; %state% echo PLEASE Un-Check The Check Box to ASK for Permission Time: %time% Date: %date%<br \/>\n&gt;&gt; %state% echo should it be displayed.<br \/>\necho.<br \/>\necho Please WAIT This can Take quite a long time this Scan is Only run<br \/>\necho If other virus Detections have been confirmed during earlier scans.<br \/>\necho.<br \/>\necho &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nif %spiesfound%==1 if %malfound%==1 goto mrtcln<br \/>\necho skipping M.R.T. On this occasion I&#8217;m feeling lazy<br \/>\n&gt;&gt; %state% echo &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n&gt;&gt; %state% echo skipping M.R.T. On this occasion<br \/>\n&gt;&gt; %state% echo as no virus to cleanup<br \/>\n&gt;&gt; %state% echo &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\ngoto skipmrt<br \/>\n:mrtcln<br \/>\necho PLEASE select CONTINUE and DE-SELECT The Check Box<br \/>\necho for &#8220;M.S. Malacious Software Removal Tool&#8221;<br \/>\necho IF it should ask for your permission to run &#8230;.<br \/>\necho should it be displayed..<br \/>\necho.<br \/>\nmalremove.exe \/Q \/F:Y<br \/>\n:skipmrt<br \/>\npathping 127.0.0.1 -n -q 1 -p 5000 &gt;nul 2&gt;&amp;1<br \/>\ncls<br \/>\n:nomalrem<br \/>\n:: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@<\/p>\n<p>if not exist &#8220;%SystemRoot%\\System32\\Contig.exe&#8221; goto nocontig<br \/>\n&gt;&gt; %state% echo Starting CONTIG this program defragments system files<br \/>\n&gt;&gt; %state% echo including the paging file and Multi Fat Table etc.<br \/>\n&gt;&gt; %state% echo.<\/p>\n<p>echo Starting CONTIG this program defragments system files<br \/>\necho including the paging file and Multi Fat Table.<br \/>\necho.<\/p>\n<p>&gt;&gt; %state% echo &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>contig $Mft<br \/>\ncontig $LogFile<br \/>\ncontig $Volume<br \/>\ncontig $AttrDef<br \/>\ncontig $Bitmap<br \/>\ncontig $Boot<br \/>\ncontig $BadClus<br \/>\ncontig $Secure<br \/>\ncontig $UpCase<br \/>\ncontig $Extend<\/p>\n<p>&gt;&gt; %state% echo &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n&gt;&gt; %state% echo.<br \/>\npathping 127.0.0.1 -n -q 1 -p 19000 &gt;nul 2&gt;&amp;1<br \/>\ncls<br \/>\n:: ::::::::::::::::::::::::::<br \/>\n:nocontig<br \/>\necho Please Scroll Down for any Software errors<br \/>\necho When NOTEPAD opens the LOG FILE to read batch log<br \/>\necho and send to chelley if their are errors listed.<br \/>\necho.<br \/>\npathping 127.0.0.1 -n -q 1 -p 5000 &gt;nul 2&gt;&amp;1<br \/>\nnotepad %state%<br \/>\ndel cleaning.tmp<\/p>\n<p>if %malfound%==0 goto nowarn<br \/>\n&gt;&gt; %state% echo MALWARE OR A VIRUS WAS FOUND<br \/>\n&gt;&gt; %state% echo YOU MAY WISH TO DO FURTHER<br \/>\n&gt;&gt; %state% echo DEEP SCANS ON YOUR COMPUTER.<br \/>\n:nowarn<br \/>\n&gt;&gt; %state% echo.<br \/>\n&gt;&gt; %state% echo Clean5.bat Completed Successfully Date: %date% Time: %time%<br \/>\necho Clean5.bat Completed Successfully %time%<br \/>\n:: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n:: &#8212;&#8212;&#8212; BELOW COMMAND DISABLED &#8212;&#8212;&#8212;<br \/>\n:: echo COMPUTER WILL SHUTDOWN IN 10 MINUTES TIME<br \/>\n:: shutdown -i -s -t 600<br \/>\n:: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n:: ::::::::::::::::::::::::::<br \/>\nsetlocal &amp; pushd .<\/p>\n<p>echo Current path is %cd%<br \/>\necho Changing directory to the path of the current script<br \/>\ncd %~dp0<br \/>\necho Current path is %cd%<\/p>\n<p>REM Run shell as admin (example) &#8211; put here code as you like<br \/>\n&gt;&gt; %state% echo %choice% Key<br \/>\n&gt;&gt; %state% echo You Pressed The: %choice% Key y = full n = quick<br \/>\n&gt;&gt; %state% echo Completed<br \/>\n&gt;&gt; %state% echo.<br \/>\n&gt;&gt; %state% echo &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\npathping 127.0.0.1 -n -q 1 -p 5000 &gt;nul 2&gt;&amp;1<br \/>\n:: cmd \/k<br \/>\nendlocal<\/p>\n<p>:: End Of Batch Cleaning Script<\/p>\n<p><span style=\"color: gray; font-size: small;\">If Dreams Come True Oleg Would be Famous so far he&#8217;s very shy, so much for Being Famous \ud83d\ude09 http:\/\/www.book-stores.com\/angels-<\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"iawp_total_views":10},"question-category":[55],"question_tags":[],"class_list":["post-6072","question","type-question","status-publish","hentry","question-category-programming"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question\/6072","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question"}],"about":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/comments?post=6072"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=6072"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=6072"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=6072"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}