Reverse filename

Would you like Bulk Rename Utility to offer new functionality? Post your comments here!

Reverse filename

Postby ruben5 » Mon May 20, 2013 12:43 pm

Hi,

I've found this utility a while ago and it saved me a lot of time. The only thing i'm missing is the option to reverse the filename.

Could you add this option?

Function Rename(OldFile)
'Create variables
Dim sName, fso, fol

' Create the filesystem object
Set fso = WScript.CreateObject("Scripting.FileSystemObject")

' Get the file extension, path and filename
sExtension = fso.GetExtensionName(OldFile)
sPath = fso.GetParentFolderName(OldFile)
sName = fso.GetFileName (OldFile)
' Strip the extension
sName = Replace(sName, "." & sExtension, "")

' Reverse the filename
NewFile = StrReverse(sName) & "." & sExtension
' Combine reversed filename with extension
NewFile = sPath & "\" & NewFile

' Rename the old filename to the new filename
fso.MoveFile OldFile, NewFile
End Function

' Get filename from commandline arguments
FileName = WScript.Arguments.Item(0)

' Call the rename function
Rename (FileName)

Thanks,

Ivo
ruben5
 
Posts: 1
Joined: Mon May 20, 2013 12:38 pm

Re: Reverse filename

Postby Stefan » Mon May 20, 2013 3:02 pm

ruben5 wrote:The only thing i'm missing is the option to reverse the filename.

Could you add this option?


OK.

Done!

Open your Bulk Rename Utility.exe and find now "File(2) Name: Reverse"





.
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU


Return to Suggestions