5

i wrote a batch script to delete shortcut virus from a usb drive and to display the hidden folder and files.

@ECHO OFF
TITLE SHORTCUT VIRUS REMOVER
ECHO SHORTCUT VIRUS TEMPORARY REMOVER
ECHO THIS TOOL IS MADE BY BHARGAB(MAXYSPARK)
SET /P DRIVE=ENTER THE DRIVE LEETER 
CD /D %DRIVE%:
DEL *.LNK
ATTRIB -H -R -S /S /D /L %DRIVE%:\*.*
PAUSE

but after converting the batch(.bat) file to .exe file using Bat To Exe Converter the .exe file is detected as Trojan Virus Why???? Screenshot Of Windows defender

I've allowed the file in Windows defender.

MaxySpark
  • 555
  • 2
  • 10
  • 26
  • Files with *.bat* extension are considered as a threat in Windows. But I'm not sure after being converted to *.exe* file is still a threat. Btw, I think Windows Defender detect it as Trojan is because your script is related to hidden files and external drive like usb. (But detected as Trojan is still weird) – Happy Face Aug 23 '15 at 15:56
  • 3
    I suspect that Defender treats all "executables with batch file hidden inside" as potential Trojan. – Raymond Chen Aug 23 '15 at 18:02

1 Answers1

9

It is because you haven't converted them to the correct architecture for your machine. I have had the same issue with the same antivirus and it was fixed by converting to x64 not x32 (default)

Rob
  • 172
  • 2
  • 3
  • 10
  • I have had the same issue and my domain name has been banned because of a link to a setup file containing an exe file generated with "bat to exe converter". If your need is to avoid the ms-dos black Window that shows up when starting a BAT file, you can use quiet.exe : http://www.joeware.net/freetools/tools/quiet/ – eosphere Dec 23 '16 at 10:58
  • this is a correct answer. upvoted – hannes neukermans Aug 16 '17 at 07:05
  • 1
    no it is not. Defender stopped considering BAT packagers as malwares but SOPHOS and others still do. The problem is with the very concept of packaging a batch in an exe, which is considered dangerous in some environments. Nothing you can do about it. – scavenger Feb 27 '20 at 02:21
  • 1
    This is not a correct anwer. I am having the same issue. My system is Windows 64 and I have tried to compile a simple batch Test.exe in 32 bits (format invisible = 21 viruses), 32 bits (format visible = 21 viruses); 64 bits (format invisible = 14 viruses); 64 bits (format visible = 14 viruses) using VirusTotal and "Exe to Bat converter.exe". By the way, the exe converter had no viruses. – Luiz Vaughan Sep 01 '20 at 13:13