How to create a batch file from .exe file?

If you mean you want to create a new batch file from an unrelated existing executable file (in other words, the batch file does something different), you do it the way you create any file. In C, you'd use fopen fwrite and fclose to create your new file and write whatever batch file commands you want to it If you mean you want to create a batch file that "intercepts" your exe file, you can do that too. If your executable file is pax.

Exe you can simply rename it to pax2. Exe and create a batch file called pax. Cmd thus: echo off pax2.

Exe This will allow you to do arbitrary actions before and after your executable runs but there are things to watch out for such as executables that return control before they're actually finsihed If, however, you're talking about converting an arbitrary executable into a batch file that performs the same task, that's much more difficult. Unless you have the source code or a very good specification on how the executable works, you're going to have a lot of trouble Automating the conversion for anything but the simplest executable will be insanely difficult And, if you want a link to a batch file that runs your executable, just create the batch file (say in c:\bin\pax. Cmd ) containing: echo off c:\bin\pax.

Exe and then create a shortcut to it from wherever you want (such as the desktop). You could even put the batch file itself in your desktop directory but I'm not a big fan of that. However, to each their own.

If you mean you want to create a new batch file from an unrelated existing executable file (in other words, the batch file does something different), you do it the way you create any file. In C, you'd use fopen, fwrite and fclose to create your new file and write whatever batch file commands you want to it. If you mean you want to create a batch file that "intercepts" your exe file, you can do that too.

If your executable file is pax. Exe, you can simply rename it to pax2. Exe and create a batch file called pax.

Cmd thus: @echo off pax2. Exe This will allow you to do arbitrary actions before and after your executable runs but there are things to watch out for such as executables that return control before they're actually finsihed. If, however, you're talking about converting an arbitrary executable into a batch file that performs the same task, that's much more difficult.

Unless you have the source code or a very good specification on how the executable works, you're going to have a lot of trouble. Automating the conversion for anything but the simplest executable will be insanely difficult. And, if you want a link to a batch file that runs your executable, just create the batch file (say in c:\bin\pax.

Cmd) containing: @echo off c:\bin\pax. Exe and then create a shortcut to it from wherever you want (such as the desktop). You could even put the batch file itself in your desktop directory but I'm not a big fan of that.

However, to each their own.

I want to make a . Bat file to run . Exe file... I have test.

Exe file in my Desktop. I want to create test. Bat on my desktop, so when I click on it, it will run the .

Exe file. Is this possible? – Davideg Aug 5 '10 at 4:49 @Davideg: yes, that's similar to my second option above and almost exactly identical to my fourth option, which appears to have miraculously and spontaneously formed for no reason whatsoever :-) – paxdiablo Aug 5 '10 at 4:57 so, you mean that I create test.

Txt file and write on it the 2 lines: @echo off c:\bin\test. Exe then I rename this file to test.bat. And that`s it.

I did this scenario but it didn`t work out. Did I forget any detail? – Davideg Aug 5 '10 at 5:11 @Davideg, that was sample code I gave, it's unlikely that your test.

Exe file will be in c:\bin. You need to put its actual path into the batch file. – paxdiablo Aug 5 '10 at 5:14 1 No, it's not.

You should use directories suited to your environment. I have a c:\bin because I always create one to dump all those little goodies that I need without having to add hundreds of different directories to my PATH. You should put your batch file where you want (e.g. , create a My Documents\batchfiles for it).

The batch file itself should contain the full path of the executable. Example, if the executable was c:\europa\eclipse. Exe, that's what you would use.

You need to use the path where your test. Exe actually is. – paxdiablo Aug 5 '10 at 5:52.

Depending on if you are a MS-DOS user or a Microsoft Windows user the instructions may slightly differ. Using Microsoft Windows you can create a batch file by going into your notepad, typing (exactly how it appears): @echo off echo this is a test batch file pause dir c:\windowsNext you will have to save the file, make sure you name it "test. Bat", because, as you can see, this is a test example to give you a feel for creating a batch file.

You can find more information here: computerhope.com/batch.htm#windows.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions