- Sep
- 6
- 0
My apologies if this has been asked and answered previously; I couldn't find it with Search.
TCC 15.01.58 x64 Windows 7 [Version 6.1.7601]
I am encountering an issue when I try to rename a group of files in a subdirectory. I tried to rename the group using delayed command expansion:
ren *.pas System.%%@name[*].pas
The command ran, and kept running, forever prefixing System. to the files over and over. My understanding is that the operation should run on the set of files matching the filespec *.pas at the beginning of the command.
Example poutput, after running for a few seconds:
E:\Source\rtl\win\System.System.System.System.System.DirectDraw.pas -> E:\So
urce\rtl\win\System.System.System.System.System.System.DirectDraw.pas
1 file renamed
E:\Source\rtl\win\System.System.System.System.System.DirectInput.pas -> E:\S
ource\rtl\win\System.System.System.System.System.System.DirectInput.pas
1 file renamed
For equivalent:
for %s in (*.pas) do ren %s System.%s
exhibits the same behavior.
The for command works with CMD.
What am I missing? I think I've done this many times in the past without incident.
Thanks in advance,
Dave
TCC 15.01.58 x64 Windows 7 [Version 6.1.7601]
I am encountering an issue when I try to rename a group of files in a subdirectory. I tried to rename the group using delayed command expansion:
ren *.pas System.%%@name[*].pas
The command ran, and kept running, forever prefixing System. to the files over and over. My understanding is that the operation should run on the set of files matching the filespec *.pas at the beginning of the command.
Example poutput, after running for a few seconds:
E:\Source\rtl\win\System.System.System.System.System.DirectDraw.pas -> E:\So
urce\rtl\win\System.System.System.System.System.System.DirectDraw.pas
1 file renamed
E:\Source\rtl\win\System.System.System.System.System.DirectInput.pas -> E:\S
ource\rtl\win\System.System.System.System.System.System.DirectInput.pas
1 file renamed
For equivalent:
for %s in (*.pas) do ren %s System.%s
exhibits the same behavior.
The for command works with CMD.
What am I missing? I think I've done this many times in the past without incident.
Thanks in advance,
Dave