#11 2011-02-17 21:39

Teknik
Member
Registered: 2011-02-17
Posts: 4

Re: Name Reversing Script

Ok so since I tried using the ''remove'' rule once and it failed, I tried using the ''delete'' rule instead. Thing is, when I add the rule, there is a conflict. How do I avoid this?

Offline

#12 2011-02-18 11:46

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,370

Offline

#13 2016-04-30 20:57

Stonefox
Member
Registered: 2016-04-30
Posts: 2

Re: Name Reversing Script

Thanks stefan, your script worked well!

Could you write one that only reverses the extension name?
e.g. report.xls becomes report.slx
or kid.jpg = kid.gpj

thanks

Offline

#14 2016-05-01 00:00

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,370

Re: Name Reversing Script

Here is a script which will reverse (invert) just the file extension:

var
  I, Count: Integer;
  Ext, NewExt: WideString;
begin
  Ext := WideExtractFileExt(FileName);
  NewExt := Ext;
  Count := Length(Ext);
  for I := 2 to Count do
    NewExt[I] := Ext[Count - I + 2];
  FileName := WideExtractBaseName(FileName) + NewExt;
end.

Offline

#15 2016-05-01 08:12

Stonefox
Member
Registered: 2016-04-30
Posts: 2

Re: Name Reversing Script

Many thanks den4b!

Works like a charm.
Using this to protect files.

Please could you do a script for symmetrical extension names, like  .rar to rename to .rra,    i.e swap 2nd and 3rd letter of extension only.

Lastly, could I rename the extensions of every file on a hard drive using a batch file?
for example :
automaticaly search and rename all of these file types [txt rar xls xlsx ppt doc docx jpeg avi mp3 mts..........etc] on a particular hard drive, e.g c drive. d drive, f drive?

Many thanks

Offline

#16 2016-05-05 13:34

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,370

Re: Name Reversing Script

Using this to protect files.

Security through obscurity is a bad idea, just to be clear.

Please could you do a script for symmetrical extension names, like  .rar to rename to .rra,    i.e swap 2nd and 3rd letter of extension only.

Have you tried modifying the script yourself to achieve this? You already have the building blocks, you just need to re-arrange them a bit. Official documentation could also come in handy.

Lastly, could I rename the extensions of every file on a hard drive using a batch file?

Sure, just save your rules as a preset and use command line options to execute a preset on any set of files, folders or even drives.

Offline

Board footer

Powered by FluxBB