Batch cant copy itself?

February 12, 2011 at 04:30:38
Specs: Windows 7, 12GHZ,12GB DDR5
This is done from .exe to a batch using %0. ive tested on other files work perfectly but this batch file is 254 kb!!! :) it spins my head just watchin it anyway once i've compiled it into an exe it becomes usually 100-120 kb, but once it does %0 it does not copy itself is this due to its share size? cause i just tested with a smaller file of 215 and compiled and it worked...

See More: Batch cant copy itself?

Report •

#1
February 12, 2011 at 15:00:16
Those "bat to exe" programs tend to make an executable that extracts the original script to a temp folder and runs it from there.

%0 will usually point to the script that was extracted, thus there is generally no way to know where the executable is.


Report •

#2
February 13, 2011 at 07:06:27
I get ur point but why did it work when i delete some of its Code, it was smaller then it worked, above 250 does not seem to work, :)

Report •

#3
February 13, 2011 at 13:22:44
Ecreate a bat file with below code.

@echo off
echo my working directory is %Cd%
echo I m being executed from %0
pause

Now, convert it to an exe and then see the output..post here as well please

Subhash Chandra.
www.s-chandra.co.cc


Report •

Related Solutions

#4
February 13, 2011 at 13:40:15
I get ur point but why did it work when i delete some of its Code, it was smaller then it worked, above 250 does not seem to work, :)

I'm not sure.......

The also normally get hit with hidden attributes and deleted when they finish running. Other than that I'm just guessing.


Report •

#5
February 14, 2011 at 04:29:27
An unknown error has occured, if the program got icon!

Works its a long directory and .tmp if i have not included a icon in the .exe

Or no thats not the case the problem lays at i have to click a button in the compiler called, Set application default settings, then it works... Auto does not


Report •

Ask Question