Jump to content
You must now use your email address to sign in [click for more info] ×

Recommended Posts

I'm not sure what your use case is, however if what you want to do is just rename all the photos in a folder with random names, you could rename the files using PowerShell.

The below script will rename all .tif and .tiff files that are in a Desktop folder called "Test", with random 8 digit alphanumeric (0-9, a-z) names.  The -WhatIf switch parameter means it will give a simulated preview and will obviously need to be removed before it will actually rename any files.  Make sure you test it is doing exactly what you want it to do before removing the -WhatIf switch parameter.


# Path and length
$Path = "$env:UserProfile\Desktop\Test"
$Length = 8

# Run
Get-ChildItem -Force -File -Path $Path | 
Where-Object { ($_.Extension -eq ".tif") -or ($_.Extension -eq ".tiff") } | 
ForEach-Object {
    $RandomName = -Join (
        (48..57 + 97..122) * $Length | 
        Get-Random -Count $Length | 
        ForEach-Object { [char]$_ }
    )
    Rename-Item -Path $_.FullName -NewName ("{0}{1}" -f $RandomName, $_.Extension) -WhatIf
}

 

001.thumb.png.7ac9ce2fcb0af62b1054771d38056244.png

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.