Q: I have a folder called LEET under the parent folder FX. inside I got a file named LEET that has no extension, but for here I am gonna call it "LEET.file". I need to write relative path command so that the batch file moves the file LEET.file to the folder FX and deletes the folder LEET after that. It looks like this: \FX\LEET\LEET.file I need to make it \FX\LEET.file The location of the bat file is irrelative since I make it go into the folder LEET and etc. I know the names are kinda confusing, but they can't be changed. I tried this to move the file: cd FX\LEET\ MOVE leet ..\ This is not working. And to delete the folder I am doing this: cd ..\ RD /s /q LEET which is working. Any help would be appreciated.
A: You need to move the file to a temporary folder, delete the LEET folder, and then move the file into FX. You cannot have a directory that contains both a file and a directory that have the same name. So you have to delete the LEET directory before you move the LEET file. so: cd FX\ md TLEET move LEET\LEET TLEET rd /s /q LEET move TLEET\LEET . rd /s /q TLEET