Jump to content

Recommended Posts

Posted (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.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.

Edited by srk999

Posted

Why the name needs to be the same? :unsure:

CD FX\LEET
REN leet l33t
MOVE l33t ..
cd ..
RD /s /q LEET
REN l33t leet

Or:

CD FX
REN leet l33t
MOVE .\l33t\LEET .
RD /s /q l33t

jaclaz

Posted
Why the name needs to be the same? :unsure:
On the light of your previous reply I had to make some changes to my original question.
Posted

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.

Posted
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.

Posted
I followed jaclaz's advice and renamed the parent folder. And it works.

Sure :), were you doubting it? :ph34r:

;)

jaclaz

I 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!

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...