Help - Search - Members - Calendar
Full Version: How do you address a file without any extension in a bat file?
MSFN Forums > Coding, Scripting and Servers > Programming (C++, Delphi, VB, etc.)

   
Google Internet Forums Unattended CD/DVD Guide
srk999
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:

CODE
cd FX\LEET\
MOVE leet ..\


This is not working.

And to delete the folder I am doing this:

CODE
cd ..\
RD /s /q LEET


which is working.

Any help would be appreciated.
jaclaz
Why the name needs to be the same? unsure.gif

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


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


jaclaz
srk999
QUOTE (jaclaz @ Aug 27 2008, 01:07 PM) *
Why the name needs to be the same? unsure.gif
On the light of your previous reply I had to make some changes to my original question.
Yzöwl
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
QUOTE (Yzöwl @ Aug 28 2008, 12:10 AM) *
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
QUOTE (srk999 @ Aug 28 2008, 09:27 AM) *
I followed jaclaz's advice and renamed the parent folder. And it works.


Sure smile.gif, were you doubting it? ph34r.gif

newwink.gif

jaclaz
srk999
QUOTE (jaclaz @ Aug 28 2008, 03:44 AM) *
QUOTE (srk999 @ Aug 28 2008, 09:27 AM) *
I followed jaclaz's advice and renamed the parent folder. And it works.


Sure smile.gif, were you doubting it? ph34r.gif

newwink.gif

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!
Google Internet Forums Unattended CD/DVD Guide
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.