Copying files in subdirectories

#1
Hi,
I know I can't do this with cmd.exe, so, I want to try it here. I'm sure TCC can do this for me.

I have a directory full of subdirectories. In each subdirectory, there's a file. I've got all these files set up in here for a test sequence I need to run. Anyway, all of the files in the respective subdirectories begin with the prefix "test." I'd like to create a couple of test files. I'd like to name the existing file "test1-" instead of just "test." And, I'd like to create a second test file, called "test2-."

Can anyone help me with this? If I'm in the parent directory, is there some way, with a regex, do a kind of "for" command, where I can creep into every sub-directory and do the above?

Thanks!
Peter
 
#9
Code:
[C:\Program Files\JPSoft\TCMD19_x64]global /?
Execute a command in the current directory and its subdirectories.

GLOBAL [/H /I /J /N /P /Q /Sn] command
        /H(idden directories)   /P(rompt)
        /I(gnore exit codes)    /Q(uiet)
        /J(unctions)            /Sn (subdirectory level)
        /N(o junctions)

[C:\Program Files\JPSoft\TCMD19_x64]
 

samintz

Scott Mintz
May 20, 2008
1,313
11
Solon, OH, USA
#10
I haven't tested this, but try:
Code:
global /i ren ::test(.*) ::test1-\1
I'm not sure what it is you want to do with test2- however. Create an empty file? Create a copy of test1-?