I'd like to create a C++ program that constantly checks the executables location and moves it to a defined location if it is not there.
This works for a one time run.
However my issue is that, when I run the executable and place the GetModuleFileName on a loop, and move the executable to a different location, the GetModuleFileName does not return the new location, of which I want it to return it, I am very new to WinAPI and barely understand the basics, so please do not start bashing me or whatever...
GetModuleFileName returns the location of the module that was loaded. The value that is returned remains constant during the lifetime of the module.
What you are asking is a non-sequiter. Files and modules are different. You load a module and then you have a module. If you copy that file elsewhere, that is independent from the module. What's more, when a module is loaded, the file is locked. So you cannot delete the file from which a running module was loaded.
Frankly, since you admit to being new to Win32, I think you should reconsider the solution you have chosen for whatever the real problem is. It is unlikely that your chosen course really is the right solution.