[Solved] Rename files from outside directory

Score
0
Vote Up
February 3, 2012 at 08:11:51 Pacific
Specs: Windows 7, i7/6 gigs

all i want to do is rename one file to another. The problem is unless i run the script from within the files folder it wont work and im not sure why.

CD C:\
rename oldfile.txt newfile.txt

works from the c drive but not d drive.


Jump to Best Answer ↓   Report •


#1
Vote Down
Score
0
Vote Up
February 3, 2012 at 08:28:33 Pacific

D Drive?
If that's your DVD drive, make sure the CD is a re-writable. If it isn't, you won't be able to edit anything on there. Only add new files till it's full.

The Batch will work as long as you have a CDRW disk.

PEBMAC - The biggest cause of Computing problems.
Damn ID10T Errors.


Reply ↓  Report •

#2
Vote Down
Score
0
Vote Up
February 3, 2012 at 08:34:43 Pacific

tx but no its not my dvd which is E.

Reply ↓  Report •

#3
Vote Down
Score
0
Vote Up
February 3, 2012 at 09:21:27 Pacific

Best Answer

You realize that "cd" changes the working directory on a drive, but doesn't change the current drive? So "cd C:\” won't change the current directory if the current drive is D:. To do that you need:

C:
cd \

Alternatively, you can use the /D switch:

cd /D C:\


Reply ↓  Report •

#4
Vote Down
Score
0
Vote Up
February 3, 2012 at 11:26:12 Pacific

i didnt know that, thanks for the solution.

Reply ↓  Report •

Reply to Message Icon Start New Discussion
Related Posts

« send me a website to down... Make selection in list bo... »