1.

Solve : Question about the rename command?

Answer»

Hi everyone

IM new to batch files, so please bear with me as I try to explain Ive got a batch file that is giving me worms actually 2 of them they look like this

rename panel.{21EC2020-3AEA-1069-A2DD-08002B30309D} panel
ren panel panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}


now when I have this folder "panel" in the same directory as the batch files they work as expected.. but I need to move these two batch files out of the same path so I tried this

cd E:\Documents and Settings\handsome\Desktop\
ren panel.{21EC2020-3AEA-1069-A2DD-08002B30309D} panel


and put it in another folder but it wont work? But if I copy and paste it into a CMD window then hit ENTER it does! THATS when I get frustrated is there a way to do an "enter" statement in dos or does someone have a suggestion?? Im sure I am OVERLOOKING some rule of DOS or something

Thanks in advance Chas

Quote from: chas_3rd on October 15, 2008, 08:41:09 AM

cd E:\Documents and Settings\handsome\Desktop\
ren panel.{21EC2020-3AEA-1069-A2DD-08002B30309D} panel


is panel.{21EC2020-3AEA-1069-A2DD-08002B30309D} in the file E:\Documents and Settings\handsome\Desktop ?

you need to change directory to where the panel.{21EC2020-3AEA-1069-A2DD-08002B30309D} is and the rename it.

FBthx yes thats where I pointed to its on my desktop

like I said if I paste this into the command prop and hit enter it works like I expect but not from the different path/directory

any clue why this isnt right ?if you the current directory is on a different drive letter, CD is not enough, you need to do CD /D otherwise you remain on the first drive letter.
You nailed it summer

where I had moved the file was on a shortcut folder which was linked to a different drive.. when I placed the files back on the same drive as the folder it works great TYVM also can you give me an example of the syntax on cd/d ?


Again thanksQuote from: chas_3rd on October 16, 2008, 06:42:51 AM
also can you give me an example of the syntax on cd/d ?

You are in drive C, in folder \apples

The prompt looks like this

C:\apples>

If you do a DIR you will SEE the files and folders in C:\apples

But now you want to be in folder C:\oranges

You type CD C:\oranges

The prompt changes to this

C:\oranges>

If you do a DIR now you will see the files and folders in C:\oranges

You want to change to a folder on drive D, called \pears.

You type CD D:\pears

but the prompt does not change. It still shows

C:\oranges>

If you type DIR you still see the files in C:\oranges.

This is because the new folder is on a different drive.

You have to type CD /D D:\pears

The prompt changes to

D:\pears>

You do a DIR and you see the files and folders in D:\pears.

Awesome ty sir/maam im one step closer to being a dos genius

Have a good one and thx again chas


Discussion

No Comment Found