The Computer Oracle

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

--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Techno Intrigue Looping

--

Chapters
00:00 Any Option To Change Windows Xp Default Copy Here Naming From &Quot;Copy Of {Name}.{Ext}&Quot; To &Q
00:52 Accepted Answer Score 9
01:54 Answer 2 Score 0
02:40 Thank you

--

Full question
https://superuser.com/questions/118351/a...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#windowsxp #rename #filenames

#avk47



ACCEPTED ANSWER

Score 9


If I understand right, you want to create duplicates of the files in the same directory. I created a .cmd file to do this via the "Send To" menu. If a name.ext.copy file already exists, it will create:

  • name.ext.copy2
  • name.ext.copy3
  • etc...

To install

  1. Go to the Start > Run... menu and type "sendto" or "shell:sendto".
  2. In the window that pops up, create a new text file.
  3. Open the new file in Notepad.
  4. Paste in the text below.
  5. Rename the text file to "Copy of.cmd" (with the quotes).

To use

  1. Select one or a group of files.
  2. Right-click on the file(s).
  3. Select the Send To... > Copy of.cmd option.

Copy of.cmd

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

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

:copy
copy %1 "%~1.copy%2"
goto :eof

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



ANSWER 2

Score 0


So I've solved that:

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

:try_copy
if not exist "%~d1%~p1%~n1{copy%2}%~x1" goto :copy
call :try_next %1 %2
goto :eof
:copy
if "%2" == "" call :try_next %1 %2
copy %1 "%~d1%~p1%~n1{copy%2}%~x1"
exit

:try_next
set /a _next=%2 + 1
call :try_copy %1 %_next%
goto :eof

I would guess the path problem you posted stems from how you made the contextmenu entry, because I do not have that problem.

[HKEY_CLASSES_ROOT\*\shell]

[HKEY_CLASSES_ROOT\*\shell\AllF01]
 @="C&@py"

[HKEY_CLASSES_ROOT\*\shell\AllF01\command]
 @="C:\\AEdNs\\nCodIP\\nCodIU\\Copy.cmd \"%1\""

I do not use MS Windows Explorer. I use various portable/freeware file managers.

All (but one) had the problem that the original script would copy the file to root "install" directory of the freeware file manager, so I added %~d1%~p1 which puts the drive\path of the original file on the output file ...

I tweaked the code in various ways for various reasons and to launch the code on any selected file(s) via the XP context menu not SendTo.