exe to batch

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
batchcc
Posts: 139
Joined: 17 Aug 2015 06:05
Contact:

exe to batch

#1 Post by batchcc » 20 Aug 2015 09:54

Hi I converted a batch file I coded to an exe but I need to edit it and I acidently deleted the file and yes I checked the recycling bin and used a data recovy program but I couldn't restore the file thanks.

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: exe to batch

#2 Post by Squashman » 20 Aug 2015 10:12

Batch to EXE converters really are not true executables. They are more of self extracting executable zip files.

When the batch file executes it will normally extract itself to the current directory or temp folder within the users profile.

batchcc
Posts: 139
Joined: 17 Aug 2015 06:05
Contact:

Re: exe to batch

#3 Post by batchcc » 20 Aug 2015 15:10

I can't find either is there a third party software that can do this?

penpen
Expert
Posts: 2009
Joined: 23 Jun 2013 06:15
Location: Germany

Re: exe to batch

#4 Post by penpen » 20 Aug 2015 15:31

If you have access to this "converter" you could try to echo the location where the batch is extracted temporarily.
Just "compile" a batch like this and run the resulting executable:

Code: Select all

@echo off
cls
call :viewSource
goto :eof

:viewSource
echo ["%~dpfn0"]
type "%~dpfn0"
echo [eof]
pause
goto :eof
This doesn't work with all batch 2 exe converters, so it may fail - but i guess it is worth a try.
The location is displayed in the first line.

Just execute and pause your executable, and search the directory for batch files.
If your batch doesn't pause on its own, you could force the program to pause by marking some text (or empty region) in the command shell.

penpen

batchcc
Posts: 139
Joined: 17 Aug 2015 06:05
Contact:

Re: exe to batch

#5 Post by batchcc » 20 Aug 2015 15:52

That won't work I used an online converter.

ShadowThief
Expert
Posts: 1166
Joined: 06 Sep 2013 21:28
Location: Virginia, United States

Re: exe to batch

#6 Post by ShadowThief » 20 Aug 2015 17:09

Which one?

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: exe to batch

#7 Post by Squashman » 20 Aug 2015 19:18

Does your batch file have a stop point in it?

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: exe to batch

#8 Post by Squashman » 20 Aug 2015 22:09

Going to assume this one.
http://www.f2ko.de/en/ob2e.php

But all of the advice still holds true. Compile another batch file and echo out the batch files current path. Put a pause in the new batch file as well. You could then do a search for the bat file while the batch file is paused.

But if the batch file you are trying to recover is running and exiting before you can copy it I am not sure what we could do.

batchcc
Posts: 139
Joined: 17 Aug 2015 06:05
Contact:

Re: exe to batch

#9 Post by batchcc » 21 Aug 2015 09:48

Than you I realized that it was stored in a sub folder in %temp%

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: exe to batch

#10 Post by foxidrive » 21 Aug 2015 10:26

batchcc wrote:Than you I realized that it was stored in a sub folder in %temp%


Winner! :)

Post Reply