Your question is a little vague, I am assuming you are looking for a batch script or simple solution that doesn't require actual programming.
Use the "Open in Terminal" context menu item to open the command prompt in your current folder. The %CD% variable will contain the directory.
You can then create a batch script "C:\Windows\copytemplate.cmd" (it doesn't have to be C:\Windows, just any folder accessible to %PATH%) with the following code
xcopy C:\template\*.* "%CD%" /E /I /Y
Now inside the command prompt you opened, you can type copytemplate.cmd and it should execute the command.
You could also create a context menu item for your command, I don't know how to do it for Windows 11 and the new explorer UI, but you can use the older method and use Shift + Right Click to view the legacy context menu.
modifying the registry can cause issues if done wrong so proceed with caution
The following is a .reg file used to modify the registry adding a "Copy Template Here"
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\CopyTemplate]
@="Copy Template Here"
[HKEY_CLASSES_ROOT\Directory\Background\shell\CopyTemplate\command]
@="cmd.exe /c xcopy \"C:\\templates\\*\" \"%V\" /E /I /Y"
