Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Run Malwarebytes in a batch script!

06 Apr 2019   #1
Paul Black

Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
 
 
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 System SpecsSystem Spec
07 Apr 2019   #2
Paul Black

Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
 
 

Well, after scouring the Internet this doesn't appear to be possible! Oh well, it was worth asking!
My System SpecsSystem Spec
08 Apr 2019   #3
Paul Black

Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.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 System SpecsSystem Spec
.

08 Apr 2019   #4
Paul Black

Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
 
 

UPDATE:

Not to worry, I forgot that is was a shell file and that I needed to do something different/specisl for it!
My System SpecsSystem Spec
09 Apr 2019   #5
Paul Black

Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
 
 

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 System SpecsSystem Spec
09 Apr 2019   #6
iko22

Windows 7 x64, Vista x64, 8.1 smartphone
 
 

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 System SpecsSystem Spec
09 Apr 2019   #7
Paul Black

Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
 
 

Thanks for the reply iko22.

Quote   Quote: Originally Posted by iko22 View Post
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 System SpecsSystem Spec
09 Apr 2019   #8
iko22

Windows 7 x64, Vista x64, 8.1 smartphone
 
 

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.
My System SpecsSystem Spec
09 Apr 2019   #9
Paul Black

Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
 
 

Once again, thanks for the reply iko22.

Quote   Quote: Originally Posted by iko22 View Post
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 System SpecsSystem Spec
09 Apr 2019   #10
iko22

Windows 7 x64, Vista x64, 8.1 smartphone
 
 

Quote:
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 System SpecsSystem Spec
Reply

Thread Tools


Similar help and support threads
Thread Forum
Help Need in batch script
Hi, I have my vendor's ftp url over SSL. it's like ftps://myvendor.com and i have username and password. So please help me on writing batch script t o downlod the file from my vendor repository. If this is not possible in dos script, please suggest me opensource tool. But i would love the...
General Discussion
Help Needed in Batch Script
Hi, I have 1000 image url in my text file(sample.txt) and i want to download the images using the url. Can anyone please share with me the sample script which can do this in single shot. Also, is there any way to reduce the size of the image into 20/20 px with png extension. Thanks
General Discussion
How to run cmd.exe elevated in batch script
Hi All, I am writing a dos batch file for windows7 and it has many commands which need elevated access to run. For elevation I am using elevate.exe. I am doing like below - set Elevation=elevate -wait cmd.exe /c %Elevation% "cd /d %CD% && xcopy /E /Y ...." %Elevation% "cd /d %CD% &&...
General Discussion
batch script help
dear all any help to make batch script this the reason i want to make a batch file is to help me update the online games in 60 computers by overwriting or copying big files in one click from 1 source computer... instead of turning on all 60 computers and updating all online games, he'll just...
General Discussion
Help me with Batch script!
Hi, Can somebody assist me with a .bat file I am trying to create? This is what I have now: start /d "C:\Users\Me\Desktop\ghost" ghost.exe start /d "C:\Users\Me\Desktop" Poweroff.exe C:\Windows\System32\powercfg.exe /setactive e428f8a5-615e-488f-b7f7-1ed39450e522The first 2 lines start...
Software


Our Sites

Site Links

About Us

Find 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 12:26.
Twitter Facebook