topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • November 20, 2018, 10:11 PM
  • Proudly celebrating 13 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: IDEA: Drag Drop renamer  (Read 1402 times)

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,014
    • View Profile
    • Donate to Member
Re: IDEA: Drag Drop renamer
« Reply #25 on: November 05, 2018, 08:51 AM »
I was using "move".

Are you moving them to a different drive?  If so, that's the same thing as a copy and will typically take longer than moving files to a different location on the same drive (which, as 4wd mentioned, is just renaming the file).

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 144
    • View Profile
    • Donate to Member
Re: IDEA: Drag Drop renamer
« Reply #26 on: November 05, 2018, 11:48 AM »
Files have no need to move. Rename is in same location.

The code used is
# DND-Rename.ps1
for ($i = 1; $i -lt $args.Count; $i++) {
Move-Item $args[$i] ($args[$i] -replace "(\.[^.]+$)", "$($args[0])`$1")
}

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 144
    • View Profile
    • Donate to Member
Re: IDEA: Drag Drop renamer
« Reply #27 on: November 05, 2018, 12:26 PM »
Have encountered an occasional issue with larger batches.

Though have not been able to narrow down. The number of files it will process seems to vary I started at 1000 error. Stepped down to around 300 error, then dropped close to above 255, worked Went back to 400, worked.
All filenames are of the same length.

Now it gets weird. The time taken for similar size batches is varying quite wildly, so something else must be going on.
« Last Edit: November 05, 2018, 01:28 PM by magician62 »

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,288
    • View Profile
    • Donate to Member
Re: IDEA: Drag Drop renamer
« Reply #28 on: November 05, 2018, 01:33 PM »
You could try to disable your antivirus... that is usually adding a lot of unpredictability to Windows' responsetimes. :o

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,016
    • View Profile
    • Donate to Member
Re: IDEA: Drag Drop renamer
« Reply #29 on: November 05, 2018, 04:38 PM »
Windows has a command line length limit.

Dropping too many files on it at once can exceed that limit.

But seems weird that it disallows then allows the same number.

Not sure whether Windows will break it into multiple commands.

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 144
    • View Profile
    • Donate to Member
Re: IDEA: Drag Drop renamer
« Reply #30 on: November 06, 2018, 02:07 AM »
Windows has a command line length limit.

Dropping too many files on it at once can exceed that limit.

But seems weird that it disallows then allows the same number.

Not sure whether Windows will break it into multiple commands.


This is what I was finding weird. I had expected I could drop the number to a point which would give me a clue. But to then accept greater numbers made little sense. The only thing I could think of was something interrupted the process. I will just have to make sure I don't try and rename too big a group :)

Accepted, it's not a perfect solution, but it has proven the concept works, and although it can be quite slow on larger batches. I would say having all the species in one screen does allow for a general increase in speed and easier processing.

The biggest time consumer is creating the shortcuts and setting icons.

I got the shortcut creation time down  creating a text list of all the species, prefixing with underscore and replacing spaces with underscore. Then prefixing the whole lot with the command. I then duplicated the shortcut 150 times renamed to species and finally properties to change the command inside.

I still have to finish the icon side :)

The concept will work for just about anything I want to add.

I also suffix with location, so have used the same technique for that too. Saves having to open a renaming program and select to create a rule for the change.

I can see a full fledged drag drop with creation from a data list would benefit those who predominantly use a mouse. 

All i need to do now is figure the best way of handling which camera in the filename. :)