srk999 Posted August 27, 2008 Posted August 27, 2008 (edited) 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.fileI need to make it \FX\LEET.fileThe 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 LEETwhich is working.Any help would be appreciated. Edited August 27, 2008 by srk999
jaclaz Posted August 27, 2008 Posted August 27, 2008 Why the name needs to be the same? CD FX\LEETREN leet l33tMOVE l33t ..cd ..RD /s /q LEETREN l33t leetOr:CD FXREN leet l33tMOVE .\l33t\LEET .RD /s /q l33tjaclaz
srk999 Posted August 27, 2008 Author Posted August 27, 2008 Why the name needs to be the same? On the light of your previous reply I had to make some changes to my original question.
Yzöwl Posted August 28, 2008 Posted August 28, 2008 You are not being permitted to have a file with the same name as its parent directory.Since you're removing the LEET directory anyhow your method is to rename it first as in jaclaz example.Try moving the LEET file into the FX\LEET directory using the GUI and you'll get a similar access is denied type message.
srk999 Posted August 28, 2008 Author Posted August 28, 2008 You are not being permitted to have a file with the same name as its parent directory.Since you're removing the LEET directory anyhow your method is to rename it first as in jaclaz example.Try moving the LEET file into the FX\LEET directory using the GUI and you'll get a similar access is denied type message.I followed jaclaz's advice and renamed the parent folder. And it works.
jaclaz Posted August 28, 2008 Posted August 28, 2008 I followed jaclaz's advice and renamed the parent folder. And it works.Sure , were you doubting it? jaclaz
srk999 Posted August 28, 2008 Author Posted August 28, 2008 I followed jaclaz's advice and renamed the parent folder. And it works.Sure , were you doubting it? jaclazI wasn't doubting it. It was a lack of planning on my part. As a result I had to rename lots of folders and then make huge changes in my script. But the important thing is, it worked!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now