Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to enable the solution to this question to work in Windows 7 but so far with out luck:

Any option to change Windows XP default Copy Here naming from "Copy of {name}.{ext}" to "{name}.{ext}.copy"

I tried by creating the .cmd file, but did not achieve exactly what I wanted to.

My basic question is suppose there is a file, xxx.ext already in a folder. When I copy to the the same folder, a file with the same name, it is named as xxx(1).ext. I want to name this as xxx_1.ext. Could you please tell me a way for this?

Is there any default setting which I have change somewhere?

share|improve this question
    
Send to is a folder containing links for Windows Context Menu. Even if you add it as a cmd you need to use Copy of from context menu to make it work. Usual Ctrl+C & Ctrl+V will have same old effects. –  SparKot ॐ Mar 5 '13 at 18:38
    
the usual ctrl+c, ctrl+v are naming the files as xxx(1).ext, xxx(2).ext. I wanna name them as xxx_1.ext, xxx_2.ext. @SparKotॐ. Could you please tell me how to do this? –  Lakshmi Narayanan Mar 5 '13 at 18:40
    
@Luke : Please read the question clearly and then make comments. I solved a part of the issue. To find the sendTo folder in windows 7. I think the first comment was also clearer. My second part is wat I have elaborated in the end! –  Lakshmi Narayanan Mar 5 '13 at 18:50
    
@LakshmiNarayanan I've tried to edit the question to clear up what you are asking. I don't believe you can override the built-in Copy/Paste filenaming. The solution in the question you linked to created a cmd file to accomplish the rename behavior and had to be triggered from the Send To menu. Is this what you have tried? –  Brad Patton Mar 5 '13 at 19:14

1 Answer 1

up vote 1 down vote accepted

It's not exactly "xxx(1).ext" on Windows 7. "File Name.ext" is copied to "File Name - Copy.ext", then "File Name - Copy (2).ext", "File Name - Copy (3).ext" and so on. Instead you want "File Name.ext" to be copied to "File Name_1.ext", "File Name_2.ext" and so on? The cmd file can be easily modified accordingly:

for %%f in (%*) do call :try_copy %%f 1
goto :eof

:try_copy
if not exist "%~n1_%2%~x1" goto :copy
call :try_next %1 %2
goto :eof

:copy
copy %1 "%~n1_%2%~x1"
goto :eof

:try_next
if "%2" == "" ( set _next=1 ) else ( set /a _next=%2 + 1 )
call :try_copy %1 %_next%
goto :eof

Edit: As per discussion below, modified batch file to copy files to a specific folder and rename sequentially:

REM Specify your destination path below without quotes or trailing backslash
set folder=I:\New folder

for %%f in (%*) do call :try_copy %%f 1
goto :eof

:try_copy
if not exist "%folder%\%~n1_%2%~x1" goto :copy
call :try_next %1 %2
goto :eof

:copy
copy %1 "%folder%\%~n1_%2%~x1"
goto :eof

:try_next
if "%2" == "" ( set _next=1 ) else ( set /a _next=%2 + 1 )
call :try_copy %1 %_next%
goto :eof
share|improve this answer
    
Thank you for your reply @Karan. Could you please temme wat coding is this? I want to learn this as well. Moreover, after I create the .cmd file, please tell me how exactly I can use it. Thanks in advance again. –  Lakshmi Narayanan Mar 6 '13 at 5:40
    
It's a batch file, and there are a gazillion tutorials on the net. As for instructions, refer to the other question you yourself linked to. Basically you just need to place this in your sendto folder. –  Karan Mar 6 '13 at 5:42
    
The explanation is given in that answer, but I tried it, and it did not work well. So please tell me how exactly I should use that file. Should I use it after copying the items to the folder having the same name? –  Lakshmi Narayanan Mar 6 '13 at 5:44
2  
What is your problem exactly? I think there might be a better solution than what you have asked for above. You have 500 files with the exact same name but different content, and want to copy them all to the same directory? Is that it? –  Karan Mar 6 '13 at 5:52
1  
Yes, I can try and edit the code and test and edit my answer, but if there's an easier way it's always preferable compared to fiddling with batch files. :) Since all files have the same name, why can't you simply search for that file name in Win Explorer, then copy all together and paste in one folder? Windows will ask you to rename, and you can select the "Do this action for all files" checkbox so all files will be renamed sequentially with (1), (2) etc. Then once all the files are there in a single dir, it'll take a few secs. to bulk rename them. –  Karan Mar 6 '13 at 6:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.