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

<< < (6/14) > >>

nkormanik:

Well, I'm running out of room on the hard disk (c:) I was using, and need to transfer my contour plot images over to (e:).....

Using Batch Shortcut Modifier, adjusting all the present shortcuts to the images now on the different drive should be a breeze.

Question:  If I should decide to convert all the .png image files to .jpg (smaller file size), what would the RegEx code be for the shortcuts modification using BSM?  In other words, if any present shortcut contains ".png", change it to ".jpg".

My present BSM.ini file is as follows:

[General]
Folder=C:\5\QQQ\shortcuts 1_x_178
PathSearch=C:\\4(.+)
PathReplace=C:\\5\1
NameSearch=(.+)
NameReplace=\1


Thanks much!


4wd:
This should do it:

NameSearch=(.+)\.png
NameReplace=\1\.jpg


You really should have a read of RegEx expressions :)

nkormanik:

NameSearch=(.+)\.png
NameReplace=\1\.jpg
--- End quote ---

Something about it seems so foreign and daunting.  For now..., glad to have you, Skwire, etc.

So the code you provided above will work for shortcuts containing the names of the files, right?

I'd think the names would be included in the total path.

As I said, hardly makes sense.


4wd:
NameSearch=(.+)\.png
NameReplace=\1\.jpg
--- End quote ---

Something about it seems so foreign and daunting.  For now..., glad to have you, Skwire, etc.-nkormanik (July 17, 2012, 10:44 PM)
--- End quote ---

I don't even pretend to be able to do the things skwire and others can do with RegEx on the forum here but for straight forward things like this I'm OK....until someone corrects me :D

So the code you provided above will work for shortcuts containing the names of the files, right?
--- End quote ---

Yes.

I'd think the names would be included in the total path.
--- End quote ---

No, I chose to treat the file path and file name as two separate entities.

nkormanik:

4wd, so the file names of shortcuts themselves will not be affected by BSM, only the contents of the shortcuts -- path to target, and filename of the target?

Here is a more complicated task, if you care to help further..., involving BOTH the target path and the target filename:

On drive e: now...

e:\1\QQQ\images\50501\...(16,000 .png images)
e:\1\QQQ\images\50502\...(16,000 .png images)
e:\1\QQQ\images\50503\...(16,000 .png images)
etc.

Within the first folder above are the files....

_50501_20101_20102_.png
_50501_20101_20103_.png
_50501_20101_20104_.png
_50501_20101_20201_.png
etc.

Within the second folder above are the files....

_50502_20101_20102_.png
_50502_20101_20103_.png
_50502_20101_20104_.png
_50502_20101_20201_.png
etc.

Notice the second (and subsequent) folder's file names are identical to the first, except for the first portion of the file name -- 50501 vs. 50502.

Using a combination of Skwire's FilePunter and 4wd's BSM, I have created a terrific set of shortcuts pointing to the files in the 50501 folder.  I regard that shortcut set as my 'gold standard.'

Example of 50501 shortcut -- path + target:

e:\1\QQQ\images\50501\_50501_20101_20102_.png

The trouble now comes in adjusting/modifying the shortcuts for the other folders, say 50502.

e:\1\QQQ\images\50502\_50502_20101_20102_.png

If possible, I'd like to use my 'gold standard' 50501 shortcuts --> copy them to, say, a 50502 shortcuts folder, and give BSM the instructions:

"BSM, take the 50502 folder full of shortcuts, look in there, when you find a path with '50501' change it to '50502.'  When you find a target filename with '50501' change it to '50502.'"

If BSM can do that, I'll repeat the process on the subsequent remaining folders.

So, what would be the BSM code for accomplishing the above task?

Present BSM.ini:

[General]
Folder=e:\1\QQQ\shortcuts 1_x_178\50502
PathSearch=e:\1\QQQ\images\50501(.+)
PathReplace=e:\1\QQQ\images\50502\1
NameSearch=(.+)
NameReplace=\1


Thanks much!


Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version