just thought i'd ask a quick question. if i'm moving files between the flash drive and the hard drive, will the Rename command still work, or do i need to copy and then copy back with the replaceinfile?
New: Kanri (Oct 9, '24), Platform 29.5.3 (Jun 27, '24)
1,100+ portable packages, 1.1 billion downloads
No Ads November!, Please donate today
Rename will work.
But replaceinfile is for changing things like drive letters inside a file and not for copying it.
"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate
Some versions of "rename" (or "move") only work within the same drive. NSIS will allow you to use "Rename" to move a file from one volume or drive to another, but it will only allow renaming of folders within the same drive.
Once you have moved the files or folders (whether you "Rename" them or use CopyFiles and then Delete) you might want to use ReplaceInFile to change references inside the files from the old drive letter or path to the new. But that should be thought of as a different step from the "Rename" step. You could write a routine that would do it on the fly in one step, but doing it in two steps with existing commands or functions is probably a more efficient way to go.
MC