Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.

You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.

All the shortcuts -- one per image above -- are burried in carefully named and organized subfolders within the particular root folder:

C:\4\shortcuts\50501\...

Now suppose we decide for whatever reason that we want to move all the images to another folder:

C:\work\images\50501\

Notice that the "4" has changed to "work".

Now all the shortcut files pointing to the first folder need to be changed accordingly.

The shortcut-altering program should be 'recursive', as the shortcuts are buried in subdirectories within the main shortcut folder. But the task is identical for each shortcut....

change

"C:\4\shortcuts\50501\(image file)"

to

"C:\work\shortcuts\50501\(image file)"

Anyone here interested in writing a program that can accomplish the task? Seems this would be a useful program. If one already exists, I haven't found it.

The solution we presently have is to recreate all the shortcuts from scratch. Skwire's "File Punter" can do that nicely. Perhaps, however, it might be appropriate to have a "Batch adjust shortcut targets" program.

Could bulk re-create the LNKs via Ctrl+A (select all the images), then hold Alt and click-n-drag to bulk create shortcuts for each image file.... Unfortunately this would put them all into where ever you dropped them (you'd then have to re-create your directory tree).

I actually need to replicate (but with tiny path-tweak) all the shortcuts 12 times. 12 huge folders of images in total.

The conundrum is..., File Punter has already created one great workable set of shortcuts. All are perfect. 16110 of 'em. Buried and organized nicely within the relevant shortcuts folder for the first set of images.

So I was hoping to simply copy the entire set of shortcuts 11 more times, and merely adjust the shortcuts (recursively) to point to the next image folder.

It's not really that I'm "moving" the first set of images. I just used that as an understandable illustration. What I'm actually doing is creating 11 more image sets, in addition to the first. So will need sets of shortcuts for each set of images. Since I have a perfect set of shortcuts for the first set of images, it does seem reasonable to use it again and again, if the path-tweak can be made for each of the additional 11 sets.

Since I have a perfect set of shortcuts for the first set of images, it does seem reasonable to use it again and again, if the path-tweak can be made for each of the additional 11 sets.

But that's what I'm saying -- just use File Punter again and create the additional rules you need. Why create an entirely new program when File Punter can already do what you want?

Based off of your other thread, I gave you two example RegEx rules necessary to create your folders. So, with 11 image sets total, you'd only have to create 22 rules total to generate all your needed shortcuts. Really, what could be easier?

BSC looks like a nice little copying program good to keep on hand. Thanks.

The structure of the shortcuts within subdirectories is different from the "Image Pool."

The motivation behind focusing on shortcuts was to avoid having to copy the image files themselves, over and over and over again, to all sorts of locations. Better to have a zillion shortcuts, paired up in various ways, all pointing to the repository of images. Easier to mix and match shortcuts.

There will be 12 major groups of images within that "Image Pool" folder: 50501, 50502, 50503, etc.

Using "File Punter" I was able to create 1 of 12 sets of shortcuts to certain of those images (50501s). So I still have 11 more sets of shortcuts to create.

If only one "Image Pool"... Then the only part of the shortcuts which will change would be the first part of the target file name. The path would be identical:

...path\50501_20104_21901.png.lnk (belongs to the first set of shortcuts)...path\50502_20104_21901.png.lnk (belongs to the second set of shortcuts)...path\50503_20104_21901.png.lnk (belongs to the third set of shortcuts)...path\etc.

I wish I could simply use the perfect set of shortcuts already created (for the 50501 set), make the ONE CHARACTER TWEAK in each filenme, and use these for the second shortcut set. And on and on. Through all 12 sets.

Appears not so easy to "Batch adjust shortcut targets", unfortunately.

=====

By the way, another approach different from shortcuts might be to put the filenames into a database, and have the database do the pairing, mixing, matching of files. But, alas, I have even less experience in that area. At least pairing up shortcuts makes sense to me.

I'll try it out, 4wd. I appreciate your efforts. Still have FolMon running on two computers, one to each side of me, chugging out images, so I'm monitoring the progress easily, thanks to you.

And Skwire, still creating shortcuts with File Punter on my main computer here. One full set of 32,220 lines of commands has been running in File Punter for nearly two days. But getting the job done. At least I think so.

OK, I was bored so I thought I'd have a play around and came up with BSM, (guess what that stands for).

It'll modify shortcuts according to the regex entered - for modify read: it will delete and then create a new shortcut according to the modified information.

You can test what will happen by checking the Test box, only the first 20 shortcut manglings will be displayed. If you enter nothing in the regex fields and hit the Go button then it will delete and then create the existing shortcuts with no changes - think of it as 'refreshing' your stale shortcuts.

For a roundup of the regex you can use, see here, for more than you ever wanted know, see here.

You can also click on the RegEx to have it open the first page in your browser, (images were grabbed before I added the RegEx link - I'm not going crazy, it only looks like it).

DISCLAIMER: Because I code for my enjoyment and not others: No error checking, trapping, safety nets, etc.

By design the program should only ever effect shortcuts, (*.lnk), but if you get it to launch a pre-emptive nuclear strike against Melbourne, Australia, just remember......I won't be around to fix the bug.

Are you saying that you have 32,220 rules/entries in File Punter? If so, why?

Well, at least we know that File Punter works successfully with such a large task. Plus I still don't understand how to do those RegEx expressions. As a side note on File Punter, by the way, seems I can leave it running and doing its thing in the background with no problem, while I search the web and work on other stuff. File Punter doesn't hog the computer resources, and doesn't trip over itself just because I bring up some website in Chrome. That's an enormous plus.

The RegEx you and jgpaiva provided (using ReNamer), though, did work great "getting rid of that extra junk" in file names. That saved me a lot of work and frustration.

4wd, boy am I glad you were bored. Appears you've created the world's ONLY Windows GUI program to alter shortcuts. Definitely beats that other 'command line' version I found. I haven't tested BSM (Batch Shortcut Modifier) yet, but it looks fantastic. Thanks a million.

To clarify the objective, let's pretend I'm having a conversation with your Batch Shortcut Modifier. I say to BSM:

"Here is a big shortcuts folder full of sub-folders, and sub-sub-folders (all neatly sliced-and-diced in a tree structure, appropriately grouped and re-grouped by purpose). Burried herein are, again, 'shortcuts' that all point to images in a huge main image folder, divided into sub-folders which hold the images. Please recursively search through everything in the big shortcuts folder. If you come upon a shortcut containing any target reference to 'C:\4\...,' please change it to 'C:\5\...'"

With v0.2, it reports Old Target/New Target, (as you can see in my post above), because the actual shortcut doesn't get renamed, (as it was doing in the prior version - I naively thought the shortcut would have the same name as the target).

Are you sure you're using v0.2 ?

Here's a directory setup as you've described above showing that the properties for the shortcut point to the old C:\4\QQQ.... path, (this is using the parameters from your Test #2 but Test #1 also worked):

Here's the Test output with arrows associating between things:

This is the result of execution, the shortcut properties now point to the image in the other directory:

Regarding the report: If nothing went wrong then all it will say is the total number of shortcuts and there was no problem. If something went wrong it will open a log file, (%TEMP%\BSM.log), in your default text editor.

NOTE: BSM works by replacing the existing shortcut by first deleting it, then creating a new one with the new data. The log will show any shortcuts that failed to be deleted or failed to be created, (mark a couple of your shortcuts as Read-Only if you want to see what happens).

« Last Edit: July 09, 2012, 05:27:49 AM by 4wd »

Logged

I do not need to control my anger ... people just need to stop pissing me off!

By the way, for those following, above in this thread was mentioned the program "Shortcuts Search And Replace." That, too, is a fine program. HOWEVER, for large jobs in my tests 4wd's BSM is about 100X faster.