My code has to move itself and some assets to a known directory(C:\windows) and it does so by check its current directory, copying the files and then restarting. To debug the program i use some msgboxes which return the various variables and i noticed that after the program copies itself and restarts,in the windows directory, the variable which holds GetCurrentDirectoryA() has still the same value as before the program moved itself. because of this the program keeps trying to move itself to the windows directory even after it has moved itself in an endless loop. is there anyway to fix this?
EDIT: i just noticed how dumb i was assuming GetCurrentDirectoryA() would return the directory of the binary, thanks. :) regarding the answer that says im trying to create a malware.... the program is meant to be a portable .exe and i dont know how to share paths among the various components, so i just copy it to a directory which i consistently know the path to.(through GetWindowsDirectory())