Well, what my program is meant to do is make a backup of a file and then copy another file to that place to to it's place, and there's also an uninstall option which deletes the other file and then place the original file back. I'm using this to be able to switch between those two files. But to make it more versatile I wanted to be able to use the batch not only from the folder it's in, but from any folder it's in. For this I made this piece of code (which again is not my complete program, but that would just be a huge field of text with a lot of echo's):
set Path=%cd%
if not exist "%Path%\main-bg.bmp" GOTO Manual
Manual:
SET Path=
SET /P Path=Type the path where main-bg.bmp is and then press Enter
if exist "%Path%\main-bg.bmp" echo %path% >> %cd%Path.txt
This checks if the original file is there, and if it is it makes a txt file with the right folder (in the same folder as the batch file, so this doesn't have to be the same folder as main-bg.bmp), I wanted to use this to be able to run the uninstall without having to set the path again. So the uninstall will have to read the .txt and use that to determine at what path it should be.
My complete program is way to big to post because of a lot of echo's to make it easier to use. I hope this post made it clearer what i am trying to do, but I assure you it's not some sort of virus or such nasty stuff.