Hack Forums
Convert a Batch (BAT) Script to an Executable (EXE) File - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Hacks, Exploits, and Various Discussions (https://hackforums.net/forumdisplay.php?fid=45)
+--- Forum: Grayhat • Purple Team • Hybrid Security (https://hackforums.net/forumdisplay.php?fid=449)
+---- Forum: Beginner Hacking (https://hackforums.net/forumdisplay.php?fid=4)
+---- Thread: Convert a Batch (BAT) Script to an Executable (EXE) File (/showthread.php?tid=5546810)



Convert a Batch (BAT) Script to an Executable (EXE) File - aerohacker - Feb 8, 2017

I created a simple batch file and I want to convert it to exe, but all the programs that I use, when I click the exe it generates a lot of repeated processes without stopping...

I created this bat to test:

@echo off
Shutdown -s -f -t 00

I enable the options to run invisible and administrator manifest, the programs compile the exe, but when I run (normal or administrator), nothing happens, and is generated hundreds/thousands of repeated processes.

Programs that I used:

- Bat To Exe Converter (Creates multiple repeated processes)
- Advanced BAT to EXE Converter v4.0 (Creates multiple repeated processes)
- BatToExe (Creates multiple repeated processes)
- Slim Bat to Exe (Opens a lot of Windows Command Prompt repeated)

I don't know what can be happening, it's a simple code to turn off the computer and the process to convert bat to exe is simple (Shoudl be).

I want to be able to convert my bat to exe files, so I can take advantage of the exe features.

What can it be?


* - Magicicada³³⁰¹ - Feb 8, 2017

Why are you trying to convert a .bat script to an executable?? This makes absolutely no sense.


* - CASTIEL - Feb 8, 2017

(Feb 8, 2017 09:11 PM)Magicicada³³⁰¹ Wrote:  Why are you trying to convert a .bat script to an executable?? This makes absolutely no sense.

It can be useful for people with malicious intent. People who want to have a .bat script execute commands to delete files, to put the system in a auto-mated reboot, etc.

But a .bat can easily be read and seems more suspicious.


* - Magicicada³³⁰¹ - Feb 8, 2017

(Feb 8, 2017 09:14 PM)CASTIEL Wrote:  It can be useful for people with malicious intent. People who want to have a .bat script execute commands to delete files, to put the system in a auto-mated reboot, etc.

But a .bat can easily be read and seems more suspicious.

Right, but why not code this in AutoIT or C# in that case? This makes no sense at all. Alternatively, OP can bind the .bat script to an executable to receive the desired result.


* - Corrupt3d - Feb 9, 2017

(Feb 8, 2017 09:18 PM)Magicicada³³⁰¹ Wrote:  Right, but why not code this in AutoIT or C# in that case? This makes no sense at all. Alternatively, OP can bind the .bat script to an executable to receive the desired result.
cus most hackers don't know of that yet and just learned basic cmd commands 🤝


* - SysAdmin - Feb 9, 2017

(Feb 9, 2017 07:39 AM)Geraar Wrote:  cus most hackers don't know of that yet and just learned basic cmd commands 🤝

Those "Hackers" shouldn't really be called hackers then.


* - Faith Connors - Feb 9, 2017

(Feb 9, 2017 08:12 AM)SysAdmin Wrote:  Those "Hackers" shouldn't really be called hackers then.

Um try again sweetie i hack with html cmd all day


* - SysAdmin - Feb 9, 2017

(Feb 9, 2017 08:25 AM)Faith Connors Wrote:  Um try again sweetie i hack with html cmd all day

ping pls.


* - Onii - Feb 9, 2017

here you go, you don't even need batch to do such simple stuff

Code
#include <windows.h>
#include <shellapi.h>

#pragma comment(lib, "Shell32.lib")

int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
  ShellExecute(0, NULL, L"shutdown.exe", L"-s -f -t 00", NULL, SW_HIDE);
  return 0;
}


c, compile as windows program and not console.
you can use the same piece of code to execute stuff other than shutdown


* - Infamia - Feb 9, 2017

(Feb 9, 2017 08:35 AM)Onii Wrote:  here you go, you don't even need batch to do such simple stuff

Code
#include <windows.h>
#include <shellapi.h>

#pragma comment(lib, "Shell32.lib")

int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
  ShellExecute(0, NULL, L"shutdown.exe", L"-s -f -t 00", NULL, SW_HIDE);
  return 0;
}


c, compile as windows program and not console.
you can use the same piece of code to execute stuff other than shutdown

vouch have tried this it works.

but why are you telling OP to use GCC/MinGW when he can't even comprehend simple concepts in programming and computers?


* - Onii - Feb 9, 2017

(Feb 9, 2017 08:56 AM)Infamia Wrote:  vouch have tried this it works.

but why are you telling OP to use GCC/MinGW when he can't even comprehend simple concepts in programming and computers?

i never mentioned gcc/mingw, i personally use PellesC for simple projects

they'll never be interested in programming if they don't hear about it/see it.