Solved Advanced Bat to EXE file converter


Sheikh

Software Developer
Power User
VIP
Local time
10:09 AM
Posts
739
Location
Tehran, IRAN.
OS
Windows 11 Pro 25H2
Hi everyone.
I have created an EXE file to repair and optimize Windows with Advanced Bat to EXE file converter.
but after exporting as EXE file and scanning it on VirusTotal website it says that it's a trojan
what should I do now? :(

here is the download link for EXE file.
I'm not a pro user and this is my first try to create an app.
So download it at your own risk:

if it's really a virus, what should I do to clean my windows from it?


here is my code:
Batch:
@echo off
REM ------------------------------------------------------------
REM ------------- Developed by S.H.E.I.K.H ---------------------
REM ------------------------------------------------------------

REM ----- This script will optimize and repair Windows ---------


REM ------------------------------------------------------------
REM --- Main Menu Design ---------------------------------------
REM ------------------------------------------------------------
:MenuBG
rem Locate 0 0
set BGcol=1
set BGcheck=[X]
rem ChangeColor 7 %BGcol%
cls

:Menu
rem Paintscreen %BGcol%
rem ChangeColor 7 %BGcol%
rem PrintBoxAt 2 2 25 50 %BGcol%
rem PrintBoxAt 3 3 3 48 %BGcol%
rem PrintBoxAt 6 3 20 48 %BGcol%
rem Locate 4 8
rem PrintColor Windows Repair Script By Sheikh V.1.0 11 %BGcol%
rem Locate 8 21
rem PrintColor Main menu 11 %BGcol%
rem ChangeColor 9 0
rem Locate 12 10
rem PrintColor 1) Repair and Optimize All 11 %BGcol%
rem Locate 14 10
rem PrintColor 2) Repair Windows 11 %BGcol%
rem Locate 16 10
rem PrintColor 3) Repair Network 11 %BGcol%
rem Locate 18 10
rem PrintColor 4) Clean and Optimize 11 %BGcol%
rem Locate 20 10
rem PrintColor 5) Exit 11 %BGcol%
rem Locate 23 10
rem PrintColor %BGcheck% Change Background color 15 %BGcol%
rem ChangeColor 10 %BGcol%

rem MouseCMD 10,12,30,12 10,14,30,14 10,16,30,16 10,18,30,18 10,20,30,20 10,23,30,23
if %result%==1 goto RepairAll
if %result%==2 goto RepairWin
if %result%==3 goto RepairNet
if %result%==4 goto Clean
if %result%==5 goto Exit
if %result%==6 goto ClearBG
goto Menu

REM ------------------------------------------------------------
REM --- Clear Background ---------------------------------------
REM ------------------------------------------------------------
:ClearBG
rem Locate 0 0
if %BGcol%==0 goto MenuBG
set BGcol=0
set BGcheck=[ ]
rem ChangeColor 7 %BGcol%
cls
goto Menu

REM ------------------------------------------------------------
REM --- Repair and Optimize All --------------------------------
REM ------------------------------------------------------------
:RepairAll
rem Locate 12 10
rem PrintColor 1) Repair and Optimize All 11 15
cls
rem Locate 0 0
rem ClearColor
cls
echo:
rem PrintColor ** Please connect to internet. if you are connected press any key to continue 14 %BGcol%
echo:
echo:
pause
cls

rem PrintColor Step1 - Scanning for damages 14 %BGcol%
echo:
echo:

rem PrintColor Disk health checker 11 %BGcol%
echo:
call chkdsk
echo:
rem PrintColor Done 11 %BGcol%
echo:
echo:

rem PrintColor Launching system file checker (verify only) 11 %BGcol%
echo:
Call sfc /verifyonly
echo:
rem PrintColor Done 11 %BGcol%
echo:
echo:

rem PrintColor Launching DISM check health command 11 %BGcol%
echo:
Call dism /online /cleanup-image /checkhealth
echo:
rem PrintColor Done 11 %BGcol%
echo:
echo:

rem PrintColor Launching DISM scan health command 11 %BGcol%
echo:
Call dism /online /cleanup-image /scanhealth
echo:
rem PrintColor Done 11 %BGcol%
echo:
echo:

rem PrintColor Step2 - Repairing 14 %BGcol%
echo:
echo:
rem PrintColor Launching DISM restore health command 11 %BGcol%
echo:
Call dism /online /cleanup-image /restorehealth
echo:
rem PrintColor Done 11 %BGcol%
echo:
echo:

rem PrintColor Launching system file checker (repair) 11 %BGcol%
echo:
Call sfc /scannow
echo:
rem PrintColor Done 11 %BGcol%
echo:
echo:


rem PrintColor Step3 - Resetting network settings 14 %BGcol%
echo:
echo:
call netsh winhttp reset proxy
echo:
call ipconfig /release
echo:
call ipconfig /flushdns
echo:
call ipconfig /renew
echo:
call netsh int ip reset
echo:
call netsh winsock reset
echo:
rem PrintColor Done 11 %BGcol%
echo:
echo:

rem PrintColor Step4 - Scanning for temporary files 14 %BGcol%
echo:
echo:
rem PrintColor Launching component store analyzer 11 %BGcol%
echo:
Call dism /online /cleanup-image /analyzecomponentstore
echo:
rem PrintColor Done 11 %BGcol%
echo:
echo:

rem PrintColor Step5 - Cleaning 14 %BGcol%
echo:
echo:
rem PrintColor Launching component store cleaner 11 %BGcol%
echo:
Call dism /online /cleanup-image /startcomponentcleanup
echo:
Call dism /online /cleanup-image /startcomponentcleanup /resetbase
echo:
rem PrintColor Done 11 %BGcol%
echo:
echo:

rem PrintColor Launching disk cleaner 11 %BGcol%
echo:
call rundll32.exe pnpclean.dll,RunDLL_PnpClean /drivers/maxclean
echo:
Call cleanmgr /sagerun
echo:
Call cleanmgr /verylowdisk /c
echo:
rem PrintColor Done 11 %BGcol%
echo:
echo:



rem PrintColor Step6 - Optimizing drives 14 %BGcol%
echo:
call defrag /C /O
echo:
echo:
rem PrintColor Done 11 %BGcol%
echo:
echo:

rem PrintColor All steps completed. 14 %BGcol%
echo:
echo:
rem PrintColor Now restart your PC. 14 %BGcol%
echo:
 
pause
goto Menu


REM ------------------------------------------------------------
REM --- Windows Repair Only ------------------------------------
REM ------------------------------------------------------------
:RepairWin
rem Locate 14 10
rem PrintColor 2) Repair Windows 11 15
cls
rem Locate 0 0
rem ClearColor
cls

rem PrintColor ** Please connect to internet. if you are connected press any key to continue 14 %BGcol%
echo:
echo:
pause
cls

rem PrintColor Step1 - Scanning for damages 14 %BGcol%
echo:
echo:

rem PrintColor Disk health repair 11 %BGcol%
echo:
call chkdsk
echo:
rem PrintColor Done 11 %BGcol%
echo:
echo:

rem PrintColor Launching system file checker (verify only) 11 %BGcol%
echo:
Call sfc /verifyonly
echo:
rem PrintColor Done 11 %BGcol%
echo:
echo:

rem PrintColor Launching DISM check health command 11 %BGcol%
echo:
Call dism /online /cleanup-image /checkhealth
echo:
rem PrintColor Done 11 %BGcol%
echo:
echo:

rem PrintColor Launching DISM scan health command 11 %BGcol%
echo:
Call dism /online /cleanup-image /scanhealth
echo:
rem PrintColor Done 11 %BGcol%
echo:
echo:

rem PrintColor Step2 - Repairing 14 %BGcol%
echo:
echo:
rem PrintColor Launching DISM restore health command 11 %BGcol%
echo:
Call dism /online /cleanup-image /restorehealth
echo:
rem PrintColor Done 11 %BGcol%
echo:
echo:

rem PrintColor Launching system file checker (repair) 11 %BGcol%
echo:
Call sfc /scannow
echo:
rem PrintColor Done 11 %BGcol%
echo:
echo:

rem PrintColor All steps completed. 14 %BGcol%
echo:
echo:
rem PrintColor Now restart your PC. 14 %BGcol%
echo:
 
pause
goto Menu

REM ------------------------------------------------------------
REM --- Network Reset Only ---------------------------------------
REM ------------------------------------------------------------
:RepairNet
rem Locate 16 10
rem PrintColor 3) Repair Network 11 15
cls
rem Locate 0 0
rem ClearColor
cls


rem PrintColor Step1 - Resetting network settings 14 %BGcol%
echo:
echo:
call netsh winhttp reset proxy
echo:
call ipconfig /release
echo:
call ipconfig /flushdns
echo:
call ipconfig /renew
echo:
call netsh int ip reset
echo:
call netsh winsock reset
echo:
rem PrintColor Done 11 %BGcol%
echo:
echo:
rem PrintColor All steps completed. 14 %BGcol%
echo:
echo:
rem PrintColor Now restart your PC. 14 %BGcol%
echo:
pause
goto Menu

REM ------------------------------------------------------------
REM --- Cleanup Commands ---------------------------------------
REM ------------------------------------------------------------
:Clean
rem Locate 18 10
rem PrintColor 4) Clean and Optimize 11 15
cls
rem Locate 0 0
rem ClearColor
cls

rem PrintColor Step1 - Scanning for temporary files 14 %BGcol%
echo:
echo:
rem PrintColor Launching component store analyzer 11 %BGcol%
echo:
Call dism /online /cleanup-image /analyzecomponentstore
echo:
rem PrintColor Done 11 %BGcol%
echo:
echo:

rem PrintColor Step2 - Cleaning 14 %BGcol%
echo:
echo:
rem PrintColor Launching component store cleaner 11 %BGcol%
echo:
Call dism /online /cleanup-image /startcomponentcleanup
echo:
Call dism /online /cleanup-image /startcomponentcleanup /resetbase
echo:
rem PrintColor Done 11 %BGcol%
echo:
echo:

rem PrintColor Launching disk cleaner 11 %BGcol%
echo:
call rundll32.exe pnpclean.dll,RunDLL_PnpClean /drivers/maxclean
echo:
Call cleanmgr /sagerun
echo:
Call cleanmgr /verylowdisk /c
echo:
rem PrintColor Done 11 %BGcol%
echo:
echo:



rem PrintColor Step3 - Optimizing drives 14 %BGcol%
echo:
call defrag /C /O
echo:
echo:
rem PrintColor Done 11 %BGcol%
echo:
echo:

rem PrintColor All steps completed. 14 %BGcol%
echo:
echo:
rem PrintColor Now restart your PC. 14 %BGcol%
echo:
 
pause

goto Menu

REM ------------------------------------------------------------
REM --- Main Menu Exit -----------------------------------------
REM ------------------------------------------------------------
:Exit
rem Locate 20 10
rem PrintColor 3) Exit 11 15
rem Wait 200
rem Paintscreen 1
rem ChangeColor 7 1
rem PrintBox 16 36 2
rem Wait 25
cls
rem PrintBox 12 28 2
rem Wait 25
cls
rem PrintBox 8 20 1
rem Wait 25
cls
rem PrintBox 4 12 1
rem Wait 25
cls
exit
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 25H2Ryzen 5 3500U8GBVega 8
    OS
    Windows 11 Pro 25H2
    Computer type
    Laptop
    Manufacturer/Model
    Huawei MateBook D15
    CPU
    Ryzen 5 3500U
    Memory
    8GB
    Graphics Card(s)
    Vega 8
    Screen Resolution
    FHD
    Hard Drives
    256GB Samsung SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    ESET Smart Security Premium
  • At a glance

    Windows 10 Enterprise LTSC 21H2intel core i7 6700HQ16GBNvidia Geforce GTX1060 (6GB)
    Operating System
    Windows 10 Enterprise LTSC 21H2
    Computer type
    Laptop
    Manufacturer/Model
    MSI GS73 6RF Stealth Pro
    CPU
    intel core i7 6700HQ
    Memory
    16GB
    Graphics card(s)
    Nvidia Geforce GTX1060 (6GB)
    Screen Resolution
    FHD
    Hard Drives
    128GB SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    Windows Defender
I get that on programs that I write as well because they are not signed.

About the only thing you can do is set an exception in your AV software for it.
 

My Computers My Computers

  • At a glance

    Win11 Pro 25H2 (RTM+)Intel i7-14650HX32 GBNo GPU - Built-in Intel Graphics
    OS
    Win11 Pro 25H2 (RTM+)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Acemagic
    CPU
    Intel i7-14650HX
    Memory
    32 GB
    Graphics Card(s)
    No GPU - Built-in Intel Graphics
    Sound Card
    Integrated
    Monitor(s) Displays
    Varies as machine will often be moved to locations with different monitors
    Screen Resolution
    Varies
    Hard Drives
    1 x 1TB Gen 4 NVMe SSD
    PSU
    120W Power Brick
    Keyboard
    Corsair K70 Max RGB Magnetic Keyboard
    Mouse
    Logitech MX Master 3
    Internet Speed
    1Gb Up / 1 Gb Down
    Browser
    Edge
    Antivirus
    Windows Defender
  • At a glance

    Win11 Pro 25H2 (RTM+)Intel i7-1255U16 GBIntel Iris Xe Graphics
    Operating System
    Win11 Pro 25H2 (RTM+)
    Computer type
    Laptop
    Manufacturer/Model
    Lenovo ThinkBook 13x Gen 2
    CPU
    Intel i7-1255U
    Memory
    16 GB
    Graphics card(s)
    Intel Iris Xe Graphics
    Sound Card
    Realtek® ALC3306-CG codec
    Monitor(s) Displays
    13.3-inch IPS Display
    Screen Resolution
    WQXGA (2560 x 1600)
    Hard Drives
    2 TB 4 x 4 NVMe SSD
    PSU
    USB-C / Thunderbolt 4 Power / Charging
    Keyboard
    Backlit, spill resistant keyboard
    Mouse
    Buttonless Glass Precision Touchpad
    Internet Speed
    1Gb Up / 1Gb Down
    Browser
    Edge
    Antivirus
    Windows Defender
    Other Info
    WiFi 6e / Bluetooth 5.1 / Facial Recognition / Fingerprint Sensor / ToF (Time of Flight) Human Presence Sensor
It's possible that the program you are using to compile to EXE is introducing a virus into your compiled EXE file, but the website looks legit, so I am wondering if this isn't a false positive? Try scanning the EXE with something like MalwareBytes or Superantispyware, or even Windows Defender and see what you get.

I can see how you might get a false positive because the bat file is digging around in some protected areas. Virus programs don't like that very much. I am surprised that Windows doesn't bark at you when you try just running the batch file. I assume that the bat file has to be run with elevated privilege? That would mean that the EXE file probably will have to be as well.

ALSO: What hsehestedt said...
 

My Computer My Computer

At a glance

Win 11 Pro 25H2Intel i7 13700KF32 GB Team Group DDR5 - 6000 CL 30ASUS TUF GAMING RTX 3070 Ti
OS
Win 11 Pro 25H2
Computer type
PC/Desktop
Manufacturer/Model
Self build
CPU
Intel i7 13700KF
Motherboard
Gigabyte Z790 UD AC
Memory
32 GB Team Group DDR5 - 6000 CL 30
Graphics Card(s)
ASUS TUF GAMING RTX 3070 Ti
Sound Card
On board Realtek
Monitor(s) Displays
ACER 34 inch
Screen Resolution
4K
Hard Drives
1 TB Samsung 980 Pro Nvme, 1 TB Samsung 970 EVO Nvme, 2 x Samsung 970 2TB SSD SATA
PSU
EVGA 1000Q
Case
Rosewill something or other
Cooling
Noctua NH-D15. A whole schwak of Noctua case fans. $$$
Keyboard
Logitech G815
Mouse
Logitech G502 Hero
Internet Speed
700 up, 600 down
Browser
Firefox
Antivirus
MalwareBytes
I get that on programs that I write as well because they are not signed.

About the only thing you can do is set an exception in your AV software for it.
I used defender and Kaspersky. it was safe.
how can I sign it?
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 25H2Ryzen 5 3500U8GBVega 8
    OS
    Windows 11 Pro 25H2
    Computer type
    Laptop
    Manufacturer/Model
    Huawei MateBook D15
    CPU
    Ryzen 5 3500U
    Memory
    8GB
    Graphics Card(s)
    Vega 8
    Screen Resolution
    FHD
    Hard Drives
    256GB Samsung SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    ESET Smart Security Premium
  • At a glance

    Windows 10 Enterprise LTSC 21H2intel core i7 6700HQ16GBNvidia Geforce GTX1060 (6GB)
    Operating System
    Windows 10 Enterprise LTSC 21H2
    Computer type
    Laptop
    Manufacturer/Model
    MSI GS73 6RF Stealth Pro
    CPU
    intel core i7 6700HQ
    Memory
    16GB
    Graphics card(s)
    Nvidia Geforce GTX1060 (6GB)
    Screen Resolution
    FHD
    Hard Drives
    128GB SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    Windows Defender
Most security products instinctively tag all Batch or PS to EXE converters, and their output EXE's as malware. That's because low-skill script kiddies can use them to hide malicious code. Because there's only a handful of these converter tools, they're easy to flag.

The simple answer is don't use an EXE. It hides your source code, if you want random users to trust your scripts.
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
Most security products instinctively tag all Batch or PS to EXE converters, and their output EXE's as malware. That's because low-skill script kiddies can use them to hide malicious code. Because there's only a handful of these converter tools, they're easy to flag.

The simple answer is don't use an EXE. It hides your source code, if you want random users to trust your scripts.
but it's really easy to use their commands.
is there any way to convert my code to an independent .bat file?
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 25H2Ryzen 5 3500U8GBVega 8
    OS
    Windows 11 Pro 25H2
    Computer type
    Laptop
    Manufacturer/Model
    Huawei MateBook D15
    CPU
    Ryzen 5 3500U
    Memory
    8GB
    Graphics Card(s)
    Vega 8
    Screen Resolution
    FHD
    Hard Drives
    256GB Samsung SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    ESET Smart Security Premium
  • At a glance

    Windows 10 Enterprise LTSC 21H2intel core i7 6700HQ16GBNvidia Geforce GTX1060 (6GB)
    Operating System
    Windows 10 Enterprise LTSC 21H2
    Computer type
    Laptop
    Manufacturer/Model
    MSI GS73 6RF Stealth Pro
    CPU
    intel core i7 6700HQ
    Memory
    16GB
    Graphics card(s)
    Nvidia Geforce GTX1060 (6GB)
    Screen Resolution
    FHD
    Hard Drives
    128GB SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    Windows Defender
I used defender and Kaspersky. it was safe.
how can I sign it?
Real signing is a pain, because a trusted CA certificate is expensive (to deter casual users from distributing malware). You can self-sign, but that doesn't really make life easier for your users since they have to install one of your exported personal certs before running it.

The bar has to be set high enough so average people can't bypass the normal security protections.
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
Now I understand the problem.
Thanks everyone.

Maybe it’s better to learn more cmd commands to create a batch file.
I just started learning about batch files 5 hours ago and found this tool in a video on youtube for almost 7 years ago :)
Sorry for that, I’m just a civil engineer not an IT pro like you my friends.
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 25H2Ryzen 5 3500U8GBVega 8
    OS
    Windows 11 Pro 25H2
    Computer type
    Laptop
    Manufacturer/Model
    Huawei MateBook D15
    CPU
    Ryzen 5 3500U
    Memory
    8GB
    Graphics Card(s)
    Vega 8
    Screen Resolution
    FHD
    Hard Drives
    256GB Samsung SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    ESET Smart Security Premium
  • At a glance

    Windows 10 Enterprise LTSC 21H2intel core i7 6700HQ16GBNvidia Geforce GTX1060 (6GB)
    Operating System
    Windows 10 Enterprise LTSC 21H2
    Computer type
    Laptop
    Manufacturer/Model
    MSI GS73 6RF Stealth Pro
    CPU
    intel core i7 6700HQ
    Memory
    16GB
    Graphics card(s)
    Nvidia Geforce GTX1060 (6GB)
    Screen Resolution
    FHD
    Hard Drives
    128GB SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    Windows Defender
Back
Top Bottom