FAQ & Knowledge Base

Welcome to our Knowledge Base. Search or browse through the topics below to find answers to your questions.

Categories: ShellBrowser Delphi Components | Show all categories

Renaming files with JamFileOperation

Question / Problem

What is the syntax for renaming a file with JamFileOperation? Where does the new file name go?
What is to do if you want to copy a file to the same folder and rename it at the same time?

Answer / Solution

To rename a file, you can use code like this:


JamFileOperation.SourceFiles.Clear();
JamFileOperation.SourceFiles.Add('C:\Temp\Shell.zip');
JamFileOperation.Destination := 'C:\Temp\Windows.zip ';
JamFileOpration.Execute();

This code will rename C:\Temp\Shell.zip to C:\Temp\Windows.zip.

To rename multiple files, you have to execute this code in a loop.