Solved Rename files from outside directory

February 3, 2012 at 08:11:51
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.

See More: Rename files from outside directory

Report •

February 3, 2012 at 08:28:33
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.

Report •

February 3, 2012 at 08:34:43
tx but no its not my dvd which is E.

Report •

February 3, 2012 at 09:21:27
✔ 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:

cd \

Alternatively, you can use the /D switch:

cd /D C:\

Report •

Related Solutions

February 3, 2012 at 11:26:12
i didnt know that, thanks for the solution.

Report •

Ask Question