Force Renaming of a File?


Is there a Chance to force the Renaming of a File in case that the resulting File already exist?


2 Files exists

F1.txt and F2.txt

When i rename F1.txt into F2.txt a Dialog pops up. In this Dialog isn't the Option to force the Renaming of the File. Instead, i have to manually delete F2.txt and after that, rename F1.txt to F2.txt.

This is boring :confused:

Well, the reason you don't see a dialog option to replace the existing file is because 'rename' only operates on the file you're renaming. It's not like copy/move for overwiting other files... This is also pretty much the way every rename facility I've ever used works, most likely since what you propose would be considered 'dangerous' :slight_smile:.

But you could probably set up a simple script (batch file) to take you're desired rename as a parameter, like run the following inside an Opus command/button/etc:

runmode hide
myrename.bat {dlgstring|Enter new filename...|{file$}}

Followed by creating a batch (myrename.bat) file in your system search path with the following commands inside:

if exist %1 dopusrt /cmd delete QUIET %1
dopusrt /cmd Select RESELECT
dopusrt /cmd rename to %1

Such a thing would basically do what you want, but would NOT work with regular 'inline' rename... Also, if it doesn't do what you expect, remember to rename the file back to it's original before you recover the deleted file from the recycle bin.


Life is dangerous :smiley:

I'll try to show you my workflow.

  1. Edit PHP-Page with Dreamweaver-Templates (with Template Control Codes in the resulting Page)
  2. Make a Copy of the Page named "Copy of PageX.PHP"
  3. Let Dreamweaver clear "Copy of PageX.PHP" off from all Control Codes
  4. Transfer "Copy of PageX.PHP" to Server
  5. Delete "PageX.PHP" on Server
  6. Rename "Copy of PageX.PHP" to PageX.PHP
  7. Done
  8. Puhhh!


  1. Edit PHP-Page with Dreamweaver-Templates (with Template Control Codes in the resulting Page)

Why not press a Button which will then...
2. Make a Copy of each selected File
3. Let Dreamweaver clear these Copys
4. Transfer these Copys to Server
5. Force Rename all "Copy of PageX.PHP" to PageX.PHP
6. Done
7. Ahhh!

You see: There is a Advantage in "Force Rename"

Is it a Feature Request for Opus 9? :smiley:

BTW: :opusicon: ist the best Piece of Software i've seen in the past Years. Great Work :sunglasses:

PS: More scripting Support in :opusicon: needed like IF and FOR EACH...(COM-Support for WSH and/or VB?)

PSPS: Regular Expressions ended with # on a FTP-Site results in hanging of :opusicon: :astonished:

I must be missing something, perhaps the Dreamweaver part as I am not familiar with that editor. But why take all the extra steps you're taking? Instead of making a copy of the changed PageX.PHP offline file, why not just upload PageX.PHP to the server and let DOpus replace the existing PageX.PHP file?

Use the Copy As function which lets you rename and copy in one step. Right-click on the Copy button on the toolbar.