ren /s does not process subdirectories

Aug 28, 2008
124
4
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.
 
May 20, 2008
11,404
99
Syracuse, NY, USA
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
12,346
150
> 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
124
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.
 
Similar threads
Thread starter Title Forum Replies Date
Jesse Heines Using Regular Expressions with the REN commanc Support 8
C Documentation Help Nit. REN / RENAME Support 0
D How to? Use regular expression with REN? Support 2
vefatica REN and NTFS streams? Support 3
samintz REN implied .* Support 2
F Regexes in REN/MOVE/… commands seem to not work at all Support 3
D How to? Wildcards as sets - looping issue with FOR and REN Support 7
samintz WAD Weird REN bug Support 6
S REN and FOR %a with files Support 8
nickles REN bug Support 11
M Ren command confusion Support 13
S Strange REN problem - non-English characters Support 3
T REN a TCC Tab from command line Support 9
D Parsing an array variable to an array does not work Support 5
J Take command does not start on Windows 10 Support 3
J ffind does not find files Support 4
Joe Caverly PAUSE does not erase countdown timer Support 0
D ParentDirectory does not update directory history Support 6
D Documentation Help "Startup" page does not describe global lists Support 0
Charles Dye Does HASH's /E option do anything? Support 1
fishman@panix.com First TCC instantiation after reboot does not work. Support 17
D Fixed @VERSION does not increment pre-fixed version numbers. Support 1
vefatica Why does @WSLPATH double the leading '/'? Support 7
D What does the file "..\Everything\Run history.csv" store? Support 5
Peter Murschall WAD rem does not work correctly Support 8
vefatica Does @SYMLINK work? Support 6
R Tree on FAT32 does not sort by name by default. Support 6
A Tcc does not recognize "bcdedit" Support 20
MickeyF Why does this batch file give me 'unknown command "else"' error? Support 17
M Ctrl-C when using command line history does nothing Support 2
vefatica JOBS /K ... how does it work? Support 5
Joe Caverly Why does TCCRT return VIEW as an internal command? Support 6
D Does TCC improve CMD's implementation of ECHO? Support 6
vefatica Find Files/Text dialog: does it work? Support 0
Alpengreis [v22.00.41] sync command flag "/X" does not work Support 22
Joe Caverly .PS1 script does not work with PSHELL Support 11
M MOVE does not behaves like intended (on failure) Support 1
R Fixed Sendmail parameter /USER= does not work Support 4
twaterloo does tcc have a task sceduler Support 4
Brian Woodward How to? Does FTP.CFG only support SSL over port 21? (Newbie) Support 6
M Activation Key does not correspond… Support 2
James Miller tcc shell window does not disappear Support 18
D Lua does not work on the commandline Support 5
D Fresh instance of TCMD does not use TCMD.INI Support 7
D Fixed @Lua does not behave as documented Support 8
D everything /o does not open the option dialog Support 4
M Why does HELP keep opening in the background? Support 0
vefatica Does TCC know I'm visiting the forums? Support 76
vefatica Why does my forum theme keep changing? Support 1
fishman@panix.com 19.02.37 Does Not Install For Me Support 2

Similar threads