Replace a file in a folder tree with an updated version?
Moderators: Hacker, petermad, Stefan2, white
Replace a file in a folder tree with an updated version?
Is there a way for Total Commander to replace files in a folder tree with an updated version?
Let's say I want to automatically update a Reshade shader with the new version in all the subfolders of my C:\Games where that file already exists...
or update the nvngx_dlss.dll Nvidia DLSS library...
Let's say I want to automatically update a Reshade shader with the new version in all the subfolders of my C:\Games where that file already exists...
or update the nvngx_dlss.dll Nvidia DLSS library...
Re: Replace a file in a folder tree with an updated version?
Code: Select all
TOTALCMD#BAR#DATA
%ComSpec% /q/c for /r %d in (.) do >nul xcopy /cdhkqruy "D:\Path\to\file.ext" "%~fd\"
syncui.dll,12
Update file in the folder structure of the active panel
1
Code: Select all
TOTALCMD#BAR#DATA
%ComSpec% /q/c for /r
"%T" %%d in (.) do >nul xcopy /cdhkqruy "%Q%N" "%%~fd\"
syncui.dll,12
Update file in the folder structure of the passive|panel with the same-name file under the cursor
1
Overquoting is evil! 👎
Re: Replace a file in a folder tree with an updated version?
Mmm... for some reason neither work for me, but I have no idea why because the cmd windows do not show any content or log.
If I disable the "run minimized" on the second one then the cmd window says: "Invalid drive specification"
My drive and path is a:\Games\
If I disable the "run minimized" on the second one then the cmd window says: "Invalid drive specification"
My drive and path is a:\Games\
Re: Replace a file in a folder tree with an updated version?
Have you read the tooltips describing the behavior of the buttons?
Overquoting is evil! 👎
Re: Replace a file in a folder tree with an updated version?
Yes. Am I doing this wrong? 
Image: https://i.postimg.cc/BQKwy5PH/image.png
Image: https://i.postimg.cc/qvHZdt2Y/image.png
Image: https://i.postimg.cc/BQKwy5PH/image.png
Image: https://i.postimg.cc/qvHZdt2Y/image.png
Re: Replace a file in a folder tree with an updated version?
What type of drive A:? And what kind of file system does it have?
Overquoting is evil! 👎
Re: Replace a file in a folder tree with an updated version?
It is an NVMe with NTFS.Fla$her wrote: 2023-11-21, 08:46 UTC What type of drive A:? And what kind of file system does it have?
Re: Replace a file in a folder tree with an updated version?
Try then with robocopy:
Code: Select all
TOTALCMD#BAR#DATA
%ComSpec% /q/c for /r
"%T" %%d in (.) do >nul robocopy . "%%~fd" "%Q%N" /ndl /nfl /njh /njs /xl /xo
syncui.dll,12
Update file in the folder structure of the passive|panel with the same-name file under the cursor
1
Overquoting is evil! 👎
Re: Replace a file in a folder tree with an updated version?
Exact same thing: blank terminal window and once it goes away I check and none of the files were updated...
Image: https://i.postimg.cc/nhgd1016/image.png
What's that syncui.dll file, btw? I have to set a different icon because I don't have that dll in my system...
Image: https://i.postimg.cc/nhgd1016/image.png
What's that syncui.dll file, btw? I have to set a different icon because I don't have that dll in my system...
Re: Replace a file in a folder tree with an updated version?
Did you add a button via the context menu and the 'Paste' item? Right?
Is the edit date of the new file newer than the existing ones?
The library is present on XP-7. Apparently, it was removed from 10/11.
Is the edit date of the new file newer than the existing ones?
The library is present on XP-7. Apparently, it was removed from 10/11.
Overquoting is evil! 👎
Re: Replace a file in a folder tree with an updated version?
I added the button using copy and paste, yes. Just changed the icon because I have no sync.dll.
File creation date is also newer.
Image: https://i.postimg.cc/SsycLMHB/image.png
File creation date is also newer.
Image: https://i.postimg.cc/SsycLMHB/image.png
Re: Replace a file in a folder tree with an updated version?
It's about the date of modification, not creation.
What will be in update.log after execution?:
What will be in update.log after execution?:
Code: Select all
TOTALCMD#BAR#DATA
%ComSpec% /q/c for /r
"%T" %%d in (.) do >nul robocopy . "%%~fd" "%Q%N" /log+:update.log /np /ns /ndl /njh /njs /v /xo /xl
wcmicon2.dll,63
Update file in the folder structure of the passive|panel with the same-name file under the cursor
1
Overquoting is evil! 👎
Re: Replace a file in a folder tree with an updated version?
Ooooh! it was the modified date. For some absurd reason the modified date was prior to the creation date.
Once set to current date it did the update ok.
Thanks, mate! much appreciated, as having to constantly update these files manually was a total pain in the arse.
Once set to current date it did the update ok.
Thanks, mate! much appreciated, as having to constantly update these files manually was a total pain in the arse.
Re: Replace a file in a folder tree with an updated version?
The reason is not absurd, but banal. If the option to save dates when copying and unpacking is not set in the settings, then this result is expected when the file appears in the folder. The problem here is that the modification date of the new version of the file doesn't exceed the modification date of the old one.jesped wrote: 2023-11-21, 16:27 UTCFor some absurd reason the modified date was prior to the creation date.
Since it's necessary to replace dll, it's technically possible to compare versions instead of dates, but in this case batch is not very suitable. If necessary, I can sketch vbs/js.
Overquoting is evil! 👎
Re: Replace a file in a folder tree with an updated version?
Where do I set that?Fla$her wrote: 2023-11-21, 23:31 UTC the option to save dates when copying and unpacking is not set in the settings
Nah, I think it's more than fine with what you already did, man. I can always set the modifed dates to current date on the new files. And it's not just for the DLSS dll, I also need to update .fx .fxh and .addon64 Reshade shaders, which I don't think would have an easy way to compare their version numbers.Fla$her wrote: 2023-11-21, 23:31 UTCSince it's necessary to replace dll, it's technically possible to compare versions instead of dates, but in this case batch is not very suitable. If necessary, I can sketch vbs/js.