ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Finished Programs

DONE: Batch adjust shortcut targets

<< < (5/15) > >>

4wd:
It won't work due to a slight oversight on my part  :-[

I stupidly changed the name of the shortcut instead of the target within the shortcut.

I'll fix it and get back to you.

OK, fixed, (I think)...well, it worked here with your example above.

UPDATE:

* Fix: Changes the target name and not the shortcut
* Fix: Modifies the working directory, (which I forgot).
* Added: A version number.
* Added: Old and New label in case the tooltips weren't enough.
It's up there.

For your case above:


And this is what you'll get:


Search for:    C:\\4(.+)
Replace with: C:\\5\1

C:\\4(.+) - Match C:\4 and put the remaining characters into a group, (one (1) in this case since it's the first group)
C:\\5\1 - Replace with C:\5 and the characters from group one, (\1).

Because \ is a special character in RegEx you need to escape it by putting \ in front, hence the \\.

nkormanik:

Fwd, something's still amiss.  Probably the RegEx...

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\...'"

I pasted in the BSM commands as you suggested, and ran two tests:

Test #1

Folder:
C:\5\QQQ\shortcuts 1_x_178\50501\20101  (a sub-sub-folder actually containing shortcuts)

Path of target:  C:\\4(.+)  changed to  C:\\5\1

Test box checked.  Recurse box un-checked.

Results....

New shortcut:

C:\5\QQQ\shortcuts 1_x_178\50501\20101\20101 20102  (correct, same as old, unchanged)

New target:

C:\5\QQQ\images\50501\20101 20102  (does NOT appear to be correct)

Test #2

Folder:
C:\5\QQQ\shortcuts 1_x_178\  (a base folder, holding sub-folders, and sub-sub-folders)

Path of target:  C:\\4(.+)  changed to  C:\\5\1

Test box checked.  Recurse box checked.

Results....

Identical to previous test, Test #1.

=====

Following the BSM testing mode, I ran BSM in actual mode.  BSM seemed very fast and efficient.

Afterward, examining (Windows) Properties window for shortcut "20101 20102[.lnk]":

Target = "C:\5\QQQ\images\50501\20101 20102"

which is not correct; should be:

Target = "C:\5\QQQ\images\50501\_50501_20101_20102_.png"

Remember, early part of path in shortcut was originally:

Target = "C:\4\QQQ\images\50501\_50501_20101_20102_.png"

so BSM did indeed successfully change the beginning of the path, as requested.

However, the end part, targeting the .png file, is not correct.

My naive hunch is the RegEx needs to be adjusted in some way.


nkormanik:

BSM enhancement request 1:

Upon successful completion of the job, small window pops up with something similar to the following, with C being the most preferred:

A)  DONE!

B)  DONE!  xxxx shortcuts processed.

C)  DONE!  xxxx shortcuts changed; yyyy shortcuts left alone.


BSM enhancement request 2:

Set up an .ini file containing the last used parameters, and re-use next time program is run.


4wd:
Test #1

Folder:
C:\5\QQQ\shortcuts 1_x_178\50501\20101  (a sub-sub-folder actually containing shortcuts)

Path of target:  C:\\4(.+)  changed to  C:\\5\1

Test box checked.  Recurse box un-checked.

Results....

New shortcut:

C:\5\QQQ\shortcuts 1_x_178\50501\20101\20101 20102  (correct, same as old, unchanged)

New target:

C:\5\QQQ\images\50501\20101 20102  (does NOT appear to be correct)-nkormanik (July 08, 2012, 11:38 PM)
--- End quote ---

OK, I'm confused here - prior to v0.2 it reported New shortcut/New target in Test mode.

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):

DONE: Batch adjust shortcut targets

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

DONE: Batch adjust shortcut targets

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

DONE: Batch adjust shortcut targets


BSM enhancement request 1:
C)  DONE!  xxxx shortcuts changed; yyyy shortcuts left alone.-nkormanik (July 08, 2012, 11:46 PM)
--- End quote ---

See what I can do.

Set up an .ini file containing the last used parameters, and re-use next time program is run.
--- End quote ---

Easy enough, I'll have it save on close.

UPDATE BSM v0.3 (here):

* Added: Saves path/regex in an ini file on exit.
* Added: Generates a report when it's finished.
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).

nkormanik:

My apologies, 4wd.  I was testing with the previous version.

Current version works perfectly.

BSM is the best Batch Shortcut Modifier on the planet.

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.

Thanks very, very much, 4wd!


Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version