ren /s does not process subdirectories

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Aug 28, 2008
92
3
#1
I discovered this bug today when trying to do a simple rename command: "ren /s *.jpeg *.jpg". The command does not process subdirectories at all, despite using the switch to make it do so. I was able to find a workaround (viz., using the "global" command), but it would be nice if the rename command worked as it's supposed to. This issue is occurring with the latest version, which shows me "TCC 11.00.47 x64 Windows 7 [Version 6.1.7600]
TCC Build 47 Windows 7 Build 7600" when I do a "ver /r" command.
 
#2
On Tue, 20 Apr 2010 22:44:11 -0400, Phileosophos <> wrote:

|I discovered this bug today when trying to do a simple rename command: "ren /s *.jpeg *.jpg". The command does not process subdirectories at all, despite using the switch to make it do so. I was able to find a workaround (viz., using the "global" command), but it would be nice if the rename command worked as it's supposed to. This issue is occurring with the latest version, which shows me "TCC 11.00.47 x64 Windows 7 [Version 6.1.7600]
|TCC Build 47 Windows 7 Build 7600" when I do a "ver /r" command.

/S is not for recursing into subdirectories (is that what you wanted?). /S if
for **renaming** subdirectories. The help for REN's /S says specifically "To
rename files throughout a directory tree, use GLOBAL REN".
--
- Vince
 

rconn

Administrator
Staff member
May 14, 2008
10,210
86
#3
> I discovered this bug today when trying to do a simple rename command:
> "ren /s *.jpeg *.jpg". The command does not process subdirectories at
> all, despite using the switch to make it do so. I was able to find a
> workaround (viz., using the "global" command), but it would be nice if
> the rename command worked as it's supposed to.
Not a bug; REN is working exactly as it's supposed to. The /S option
renames subdirectories, it does not recurse into subdirectories (and never
has). It isn't feasible to add recursion to REN without serious
compatibility and syntax issues (plus the opportunity to do major harm to
your file system).

However, there are a number of existing ways to do what you want, including
FOR, DO, and GLOBAL.

Rex Conn
JP Software
 
Aug 28, 2008
92
3
#4
Well that explains much. I incorrectly expected the /s switch to do what it does with so many of the other commands. And when I checked the help file, I merely looked up at the top where I saw that the switch was about subdirectories; I didn't read the detail. Thanks for clearing that up and sorry about the mistaken "bug" report.