The %0 in DOS is shorthand for "the filename of the program currently running". The %0 is interpreted by the DOS batch processing program. What it does is call some system routine or look at some system global variable (not sure which) and replace the %0 with that text.
If you are programming, you have to do the interpretation replacement yourself.
Look for a library routine or system global variable that is "the filename of the currently running program". That routine/variable should return a string, which should be the name you want.
The exact nature of the call will depend on your execution context (.NET, not .NET, Win2K, Win98, C++, C#, C, Java, Perl, etc.).
It should take no more than a few minutes to find the correct call.
Here is one web site I found in 7 minutes of web search that may or may not apply to the context you are executing. It should give you some ideas on how to do the "move" even while the file is executing (it is easy in Unix/Linux, harder in Windows):
http://www.catch22.net/tuts/selfdel.aspIt mentions the following call, which may be the translation function you are looking for:
TCHAR szEXEPathname[_MAX_PATH];
GetModuleFileName(NULL, szEXEPathname, _MAX_PATH);
Regards