Run Malwarebytes in a batch script!

Page 1 of 2 12 LastLast

  1. Posts : 6,021
    Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
       #1

    Run Malwarebytes in a batch script!


    Good evening,

    I am trying to run Malwarebytes [v3.5.1.2522] that was downloaded to the default location in a batch script running in Vista 32-bit but without much success at the moment!

    I am basically trying to run a quick scan in silent mode. This is what I have tried [among many other variations]...

    Code:
    C:\PROGRA~1\Malwarebytes\Anti-Malware\mbam.exe /quickscan-silent
    Do I need to use something like...

    Code:
    C:\PROGRA~1\Malwarebytes\Anti-Malware\mbamapi /scan -quick -silent -remove
    Has anyone got any ideas please?

    Thanks in advance.
      My Computer


  2. Posts : 6,021
    Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
    Thread Starter
       #2

    Well, after scouring the Internet this doesn't appear to be possible! Oh well, it was worth asking!
      My Computer


  3. Posts : 6,021
    Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
    Thread Starter
       #3

    I have a folder on the desktop that I am unable to open in a batch file.

    The properties when clicked on the desktop say that it is a folder.
    When double-clicked it opens in explorer as a folder under desktop.
    When the properties are clicked there it shows as...

    File (.{aanaannn-nann-nnna-nnna-nnnnnnnnnnna})

    Numbers and characters replaced with alpha [a] and numeric [n] letters.

    When the icon it is double-clicked on the desktop it opens fine!

    Thanks in advance.
      My Computer


  4. Posts : 6,021
    Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
    Thread Starter
       #4

    UPDATE:

    Not to worry, I forgot that is was a shell file and that I needed to do something different/specisl for it!
      My Computer


  5. Posts : 6,021
    Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
    Thread Starter
       #5

    I wonder if anyone can help with this please!

    I have a test computer that I use and often save shortcuts/icons/files [anything really] to the desktop.
    I have setup a .bat file that I always leave open from which I can run each the following:

    01. chkdsk.
    02. sfc.
    03. Extended Disk Cleanup.
    Malwarebytes [N/A].
    05. CCleaner.
    06. Empty Recycle Bin.
    07. Defragment.
    08. Revo Uninstaller.
    09. System Specifications.
    10. Quit Program.
    11. Sleep.
    12. Restart.
    13. Shutdown.

    Using a batch script [that I can incorporate into my .bat file as a menu option], I want to delete everything [shortcuts/icons/files] off of the desktop except the .bat file itself and one folder.

    Would it be something like this to leave the .bat file:

    Code:
    for %%i in (%userprofile%\desktop\*.*) do if not "%%i"=="MyBatFile.bat" del /q "%%i"
    Has anyone got any ideas please?

    Thanks in advance.
      My Computer


  6. Posts : 2,798
    Windows 7 x64, Vista x64, 8.1 smartphone
       #6

    Hi Paul,

    you don't say what %%i is or where it is from. I understand what it isn't from your example, and I made this command: dir *.* /b /s | find /v "MyBatFile.bat". Remeber that FIND is case sensitive in what it finds.
      My Computer


  7. Posts : 6,021
    Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
    Thread Starter
       #7

    Thanks for the reply iko22.

    iko22 said:
    You don't say what %%i is or where it is from. I understand what it isn't from your example, and I made this command: dir *.* /b /s | find /v "MyBatFile.bat". Remeber that FIND is case sensitive in what it finds.
    The %%i is the loop variable.

    The code you posted lists files.

    I want to delete everything [shortcuts/icons/files] off of the desktop except the .bat file itself and one folder.

    Thanks in advance.
      My Computer


  8. Posts : 2,798
    Windows 7 x64, Vista x64, 8.1 smartphone
       #8

    Hello Paul

    The code I posted lists files except the .bat file. I was unable to test the del command on my computer.

    You might have to run something like this:
    dir *.* /b /s | find /v "MyBatFile.bat" > output.txt
    type output.txt | find /v "subdirectory_name" > out2.txt
    del < out2.txt

    But like I say, I cannot test the syntax of this batch on my computer.
    Last edited by iko22; 09 Apr 2019 at 13:59. Reason: Add forgotten " quote
      My Computer


  9. Posts : 6,021
    Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
    Thread Starter
       #9

    Once again, thanks for the reply iko22.

    iko22 said:
    The code I posted lists files except the .bat file.
    I appreciate that.

    Seeing it is only the desktop that I am interested in I used the code:

    Code:
    C:\Users\MyUserName\Desktop .* /b /s | find /v "=="MyBatFile.bat"
    The .* is correct above in the code, and obviously C:\Users\MyUserName\ will be replaced in the batch script with %userprofile%/.

    The thing is, the list of the other files [not including "MyBatFile.bat"] includes the single folder, which I don't want deleted, and some C:\Users\MyUserName\AppData\Roaming|Mozilla\Firefox files, which is strange because I don't have Firefox on the desktop so it must be a hidden system file!

    It also doesn't include the shortcuts/icons which I also want deleted.

    Obviously the desktop.ini files don't show up in the list.

    Thanks in advance.
      My Computer


  10. Posts : 2,798
    Windows 7 x64, Vista x64, 8.1 smartphone
       #10

    It also doesn't include the shortcuts/icons which I also want deleted.
    That is odd. The .ink files do not show up in the output of a DIR command. I'd not noticed that before. You still can delete the shortcuts with del *.ink. So you would add another line to the batch file, saying del *.ink.
      My Computer


 
Page 1 of 2 12 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 20:33.
Find Us