Welcome Guest.   Make a donation to an author on the site November 01, 2014, 07:40:25 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
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.
 
The N.A.N.Y. Challenge 2010! Download 24 custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: Prev 1 [2] 3 Next   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: DONE: Batch adjust shortcut targets  (Read 15097 times)
nkormanik
Participant
*
Posts: 291

View Profile Give some DonationCredits to this forum member
« Reply #25 on: July 17, 2012, 08:56:13 PM »


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!


Logged
4wd
Supporting Member
**
Posts: 3,382



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #26 on: July 17, 2012, 09:22:49 PM »

This should do it:

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


You really should have a read of RegEx expressions smiley
Logged

I do not need to control my anger ... people just need to stop pissing me off!
nkormanik
Participant
*
Posts: 291

View Profile Give some DonationCredits to this forum member
« Reply #27 on: July 17, 2012, 10:44:29 PM »


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

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.


Logged
4wd
Supporting Member
**
Posts: 3,382



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #28 on: July 17, 2012, 11:09:08 PM »

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

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

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 cheesy

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

Yes.

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

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

I do not need to control my anger ... people just need to stop pissing me off!
nkormanik
Participant
*
Posts: 291

View Profile Give some DonationCredits to this forum member
« Reply #29 on: July 18, 2012, 11:58:15 PM »


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!


Logged
4wd
Supporting Member
**
Posts: 3,382



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #30 on: July 19, 2012, 04:54:52 AM »

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

(.+)\\50501(.*) - Group, (1), everything up to \50501 and group, (2), everything after, (even if there's nothing).
\1\\50502\2 - Replace with group 1 followed by \50502 followed by group 2.

_50501(.+) - Group, (1), everything after _50501.
_50502\1 - Replace with _50502 followed by group 1.

Spent an hour wondering why it wouldn't work until I realised that putting \150502 meant insert everything from group 150502...which doesn't exist.  Hence the need to include \\ to search/replace the \ before 50501.
Logged

I do not need to control my anger ... people just need to stop pissing me off!
nkormanik
Participant
*
Posts: 291

View Profile Give some DonationCredits to this forum member
« Reply #31 on: July 20, 2012, 02:14:27 AM »


4wd's Batch Shortcut Modifier, BSM, just finished adjusting nearly 700,000 shortcuts in a large directory tree -- all without hitch.

Thanks so much, 4wd, for some really helpful software!


Here are some possible enhancement for BSM, but by no means necessary.  BSM is great as is presently, in my opinion:

-- Progress indicator while Testing -- I wasn't sure anything was happening, so stopped BSM via Task Manager.

-- Remember preferred size/layout of Test window (BSM.ini file entry?)

-- Remember state of check boxes, such as Recurse on (BSM.ini file entry?)

-- Change Go ---> Stop, once process is underway.

-- Change notice when hovering over Go to "Starts Shortcut Modification"


Logged
4wd
Supporting Member
**
Posts: 3,382



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #32 on: July 22, 2012, 12:18:28 AM »

4wd's Batch Shortcut Modifier, BSM, just finished adjusting nearly 700,000 shortcuts in a large directory tree -- all without hitch.

Thanks so much, 4wd, for some really helpful software!

Good to know at least one of my programs works smiley


Quote
- Progress indicator while Testing -- I wasn't sure anything was happening, so stopped BSM via Task Manager.

Unfortunately, when it's sitting there looking like it's not doing anything, it's actually recursing through the folders looking for shortcuts, _all_ shortcuts, not just the first 20 for the test output.

Because the collecting of shortcuts is performed by an external function written by somoeone else, I'd need to rewrite parts of it to enable some form of indicator/interrupt, something I don't normally like doing because the functions were written by people with far more knowledge in AutoIt than me.

The time between the completion of shortcut collection and displaying the test output is less than a second - that bit is outside the above function and that's when the progressbar kicks in, 0->20 in less than a second.  I could change the Go->Stop->Go in that period but the change is almost instant - you don't have time to press Stop.

Quote
-- Remember preferred size/layout of Test window (BSM.ini file entry?)

That I can do, requires using another external function but seems easy enough.

Quote
-- Remember state of check boxes, such as Recurse on (BSM.ini file entry?)

-- Change Go ---> Stop, once process is underway.

-- Change notice when hovering over Go to "Starts Shortcut Modification"

They're easy.

As I suggested in the TCBOO thread, could you use skwire's ZeroZipper to zip up the tree with all the shortcuts and the tree with all the images, then just attach the archives in a PM - they should only be a few MB in size, then I'll have something to test against.
Logged

I do not need to control my anger ... people just need to stop pissing me off!
nkormanik
Participant
*
Posts: 291

View Profile Give some DonationCredits to this forum member
« Reply #33 on: July 22, 2012, 01:54:02 AM »


I'm using Folder Monitor (FolMon) all the time now.  Another example of your excellent work.

Thinking more about BSM, best to simply leave well enough alone.  Works terrifically.  Maybe someone else will have a substantive enhancement request at some point.  Who knows.

The images file folder = 50 gb
One tree of shortcuts = 1.45 gb
Another tree of shortcuts = 1.47 gb

I'll try using Skwire's ZeroZipper, and see how that goes.

If not, no worries.  Things are now all set up the way I had hoped.

Thanks again for your generous assistance!


« Last Edit: July 22, 2012, 02:03:59 AM by nkormanik » Logged
4wd
Supporting Member
**
Posts: 3,382



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #34 on: July 22, 2012, 02:28:17 AM »

Thinking more about BSM, best to simply leave well enough alone.

huh Does that mean you don't want the radically faster version?

Still can't interrupt the fetching of shortcuts but time to fetch is >60% less than previous version, (just changed to using DOS dir command).

Now saves test output window size/position and resizes columns to fit contents, saves state of checkboxes, added a statusbar so at least it looks like it's doing something.

Haven't done the Go->Stop during processing yet - next day or so should see it finished.

Still like a copy of your image/shortcut tree so I can see if I can find where TCBOO is going belly up - the limit on string length is 2,147,483,647 characters, (which is a lot), so it would be interesting to see what's actually failing.
Logged

I do not need to control my anger ... people just need to stop pissing me off!
nkormanik
Participant
*
Posts: 291

View Profile Give some DonationCredits to this forum member
« Reply #35 on: July 22, 2012, 02:31:28 AM »


My goodness.  Definitely would like the new version, then.

I'm not positive how to send a PM.  Would you briefly say how?


Logged
4wd
Supporting Member
**
Posts: 3,382



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #36 on: July 22, 2012, 02:46:15 AM »

Looks like you'll have to email them to me, no attachments in PMs.

And for future reference, to send a PM:

« Last Edit: July 22, 2012, 08:05:45 PM by 4wd » Logged

I do not need to control my anger ... people just need to stop pissing me off!
nkormanik
Participant
*
Posts: 291

View Profile Give some DonationCredits to this forum member
« Reply #37 on: July 22, 2012, 02:50:06 AM »


Will do.  Zero Zipper is now chugging along.


Logged
nkormanik
Participant
*
Posts: 291

View Profile Give some DonationCredits to this forum member
« Reply #38 on: July 22, 2012, 07:42:27 PM »


Will send link by PM to one of those file-sharing sites.  Resulting file was too large to send by email.

Using Skwire's Zero Zipper, and letting it keep running while I went to bed:

ContourPlots.zip = 206 mb

I recompressed into .rar format, best compression:

ContourPlots.rar = 80 mb


Hope the file helps with whatever you want to attempt.


Logged
4wd
Supporting Member
**
Posts: 3,382



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #39 on: July 23, 2012, 04:10:58 AM »

Thanks - I might have to slow it down a bit, it found 768780 shortcuts in 13.5 seconds - hardly enough time to make a cuppa.

Slightly better than the 62 seconds that v0.3 took.

UPDATE (v0.5) here:
  • Scanning for shortcuts is a bit faster, (relies on DOS dir command).
  • Saves position of main window and test output window, (will be saved when the respective window is closed).
  • Saves state of checkboxes.
  • Can interrupt shortcut processing, (not scanning though) - log file will open by default when interrupted.
  • Added a statusbar so it looks like it doing something.
Logged

I do not need to control my anger ... people just need to stop pissing me off!
nkormanik
Participant
*
Posts: 291

View Profile Give some DonationCredits to this forum member
« Reply #40 on: July 23, 2012, 03:08:03 PM »


Wow.  Pure magic.

Thanks for sticking with it.

Hope others find and use your programs.


Logged
weberxw
Participant
*
Posts: 7

View Profile Give some DonationCredits to this forum member
« Reply #41 on: September 26, 2014, 02:04:42 PM »

4wd, I hope you steel here 2 years later  cheesy
I'm trying to use BSM but I keep recieving this msg: Line 9834 - Error: Subscript used with non-Array variable.
I'm using BSM 0.5.

What I need is:
My shortchuts are in this folder: C:\Users\Rodotec2\Documents and I want to change the path and name of then monthly, so in September I'll have a path like this:
D:\RODOTECPAV\NF - Rod\09 2014\NF PDF but in October i need to change it for D:\RODOTECPAV\NF - Rod\10 2014\NF PDF

And the name are: PDF 09.2014 RODOTEC and I need to change it for PDF 10.2014 RODOTEC


Can you please help here?
Thank you for your work, i'm prety sure your BSM can solve my problem.
Logged
weberxw
Participant
*
Posts: 7

View Profile Give some DonationCredits to this forum member
« Reply #42 on: September 26, 2014, 04:42:41 PM »

Omg, I just set the "Recurse" checkbox.... and now works PERFECTLY.... I don't know if someone is seeing this still, but BSM works great!
Logged
4wd
Supporting Member
**
Posts: 3,382



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #43 on: September 27, 2014, 07:26:34 AM »

Omg, I just set the "Recurse" checkbox.... and now works PERFECTLY.... I don't know if someone is seeing this still, but BSM works great!

I'm still here, so does that mean it's working OK for you now?

The error you got previously seems to indicate a problem, I'll have a look at it in a few weeks when I'm back in-country, (OS ATM).
Logged

I do not need to control my anger ... people just need to stop pissing me off!
weberxw
Participant
*
Posts: 7

View Profile Give some DonationCredits to this forum member
« Reply #44 on: September 27, 2014, 02:22:14 PM »

Yes, work in part.
I was able to change the path, this works fine.
But I couldn't change the name using the same search parameters..

For example:
I change the path from D:\RODOTECPAV\NF - Rod\09 2014\PDF\ to D:\RODOTECPAV\NF - Rod\10 2014\PDF\
Using the parameter 09 (old path) 10 (new path)... this works nice and prety simple

But I tried to change the name using the same parameters and nothing changes...
My shortuct names are like PDF 09.2014 Rodotec

Am I doing something wrong?
The parameters to change the name are diferent?

Thanks again, happy to see you here yet hehe
Logged
4wd
Supporting Member
**
Posts: 3,382



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #45 on: September 28, 2014, 03:40:16 PM »

What RegEx are you using?

Screenshot of the interface, (for the RegEx), together with the Test window would be good also.
Logged

I do not need to control my anger ... people just need to stop pissing me off!
gendalf
Participant
*
Posts: 3

View Profile Give some DonationCredits to this forum member
« Reply #46 on: September 29, 2014, 06:07:29 AM »

BSM shows Error: Subscript used with non-Array variable. for me
i'm trying to change Disk letter of all of the shortcuts paths in the start menu.
i tried: G:\\(.*) -> D:\\\1 , G:(.*) -> D:\1 , $G(.*) -> D\1 , "G(.*) -> "D\1
all give me that error with or without test&recurse checkboxes
« Last Edit: September 29, 2014, 07:36:23 AM by gendalf » Logged
weberxw
Participant
*
Posts: 7

View Profile Give some DonationCredits to this forum member
« Reply #47 on: September 29, 2014, 07:32:09 AM »



Like you can see on the screenshot, I was able to change the path but not the name.
What I'm I doing wrong?

Thanks again.
Logged
nkormanik
Participant
*
Posts: 291

View Profile Give some DonationCredits to this forum member
« Reply #48 on: September 29, 2014, 07:17:36 PM »

Glad BSM is being kept alive.  It's a much needed addition to our tool set.

Logged
gendalf
Participant
*
Posts: 3

View Profile Give some DonationCredits to this forum member
« Reply #49 on: September 29, 2014, 10:33:10 PM »


nkormanik, if by keeping alive you mean its not working at all  Grin
Logged
Pages: Prev 1 [2] 3 Next   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.044s | Server load: 0.15 ]