Photoname Portable, the command line arguments

These are the command line arguments that control the actions of pnp.exe, that you can send to it:

-fld [folder]

Renames all images in a specific folder. Specify the folder with images you want to rename, or type start to search for images in the same folder that pnp.exe is started from. Starting pnp.exe like this (from the command prompt):

pnp.exe -fld start

…has the same effect as double clicking it and type:

Rename Folder Start

Also, starting pnp.exe like this:

pnp.exe -fld “C:\Temp”

…has the same effect as double clicking it and type:

Rename Folder “C:\Temp”

-fle [filename]   Gives the specified file a new name. The file must be a jpg file that isn’t already renamed according to the Photoname convention.
-h Shows the available command line arguments.

Download Photoname Portable (25kb).

Photoname Portable

The portable version of Photoname (pnp.exe) doesn’t have a GUI, but it is pretty simple to use anyway. You can either start it from the command interface and pass arguments to it to tell it what to do, or you can double click on it, and then tell it what to do. If you want to control pnp.exe from another application, you must know what arguments you can pass to it.

So, pnp.exe is a portable, lightweight GUI-less version of Photoname.
Some of the commands that you can run if you start it without arguments, that is, just by double clicking it:

Load {Filename} loads an image into memory. If the path or filename contains a space, you need quotation marks around it. Example:

Load "C:\Images\CW005132.jpg"

To view information about the loaded image, type Info. If you provide a filename, that file is loaded and info about that file is displayed. Example:

Info

Info "C:\Images\CW005133.jpg"

To rename one single file, use Rename File {Filename}. Example:

Rename File "C:\Images\CW005134.jpg"

If you ignore the filename, the currently loaded file will be renamed. To rename all files, use Rename Dir {Directory name}. Example:

Rename Dir "C:\Images"

Files that already match the RegEx pattern \d{14}_\d*\.(jpg|jpeg) will be ignored. If photodate is missing in the file, the change date will be used instead. The renamed file will be unloaded from memory in the process of renaming.

Photoname Portable can only handle full path, not relative paths.

For each file that Photoname Portable tries to rename, the output will be a text line that starts with “Ok.” for successful name change and “Rename failed.” for unsuccessful name change.

If you want to use the portable version to rename all images that need renaming, without any tricky typing, you can just type Dir? in the command prompt. Photoname Portable will ask you for a directory, do the name changes and then exit. Example:

Dir?

If you are automating Photoname Portable from another application, consider not sending “Dir?” to it. ;-) The folder browser might show up behind the console window.

Download Photoname Portable (25kb).

PhotoName improvements, December 2009

The following changes are made to PhotoName.

The Options dialog (click Behaviour and Other settings) lets you control what will happen if you double click an image in the list.

A new drop down menu (Edit) is added to the menu bar. From there you can change what images are selected in the list. You can choose to select all images, no images or toggle the selection.

Also, you can view all images as thumbnails, and click on the images you want to select or deselect. To do this, click Edit and Select from thumbnails.

This is very effective if you want to export images as a gallery, because you have a good overview of what pictures you have in the selected directory and which of them will be included in the gallery.

You can download PhotoName from here.

PhotoName improvements, September 2009

Two changes have been made.

PhotoName does a more effective image caching to be able to display thumbnails faster, and a directory list is added.

The directory list can be used to navigate to any child directory or to the parent directory, without having to open the folder browser. Also, the directory list tells you if any child directory has own child directories or images.

Download PhotoName from this page, but remember to uninstall any previous version first.

F# and PhotoName

I have just decided to look in to F#, the new functional .NET language by Microsoft. It installs with Visual Studio 2010, and it can be installed for Visual Studio 9. I use Visual Studio 9 for my everyday work, so I installed it from here (click on the word MSI in the first paragraph under “F# Compiler versions”). After installation, a couple of new project templates are available, including a good tutorial. Thanks for that, Microsoft!

And now for something less positive. I got a comment today on PhotoName on a never-do-this-thing in my source code. I was storing values in the registry under HKEY_LOCAL_MACHINE, something that you might want to do in an installation process, but never in an installed program. Back in the Windows 2000 days (or even XP), I thought of the Local Machine hive key as an alternative to the Current User hive key, with bigger scope. This is not good practice, and by default in Vista, Windows prevents programs from doing this. This is good, of course, and bringing this old mistake up to the surface, so that it could be fixed. I am a Vista user myself, but I actually use PhotoName on an old XP machine, so I am very thankful that this issue was brought up, so that I could update my code. If you have an older project, that you develop on a XP machine, you should make sure that you’re not using Application.CommonAppDataRegistry.SetValue but Application.UserAppDataRegistry.SetValue instead.

If you have an older version of PhotoName installed, uninstall it from the Control Panel before installing the new version.