By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Copying files in subdirectories

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?

Have you looked into GLOBAL? (Hint: You usually want to use /I with this command.)
Have you looked into GLOBAL? (Hint: You usually want to use /I with this command.)
I tried "GLOBAL." I've never heard of it, but, I'm reading about it. Looks cool. But, no, I can't get it to work. It keeps saying "the parameter is incorrect."
[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]
I haven't tested this, but try:
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-?
[FOX] Ultimate Translator