Jump to content
Macro Express Forums

Globally changing shortcut links?


Recommended Posts

On my XP (SP3) PC I'm about to move 'My Documents' (in some folders quaintly but confusingly called 'Terry's Documents') from C:\Docs to I:\Docs.

 

Has anyone written a macro they are happy to share that will automatically rename the thousands of shortcuts that will be affected please?

 

I will still have major work to change other references (such as all those Program Launch and other commands in my Macro Express Pro macros) but I'll tackle those later.

 

--
Terry, East Grinstead, UK

 

 

Link to comment
Share on other sites

You shouldn't need to do this. My Documents is not a folder per se. It's a kind of redirector. I built a new machine a few days ago and I'm using a 240G mSATA (think flash card on motherboard) for the primary OS drive and have a 2TB platter drive for storage installed as my "A:" drive. The mSATA is too small for all my data so I moved it to the big platter. A properly composed shortcut should use this path with the redirection so that if you change the location of your "My Documents" they should all still work.

 

Under Windows Explorer go to your Libraries. Then expand your "Documents" library so you can see both your "My Documents" and "Public Documents". Right click "My Documents" and select Properties. In the Location tab simply give it a new path. When you back out it will ask you if you want to move all your content to the new location. Accept that and you're done.

 

I did try to programmatically change shortcuts in MEP once and failed. You might see if someone has written a utility to do this.

Link to comment
Share on other sites

Thanks Cory. I'll make the re-direction in My Documents Properties over the next day or so, when I've finished a video project that's nearing completion (with source files from far and wide) and report back.

 

Edit, Thursday 19 September 2013, 07:53 UK time:

 

Are you sure about that Cory? I haven't yet tried it. It will have such an immediate dramatic effect on all my usage, so I'm being especially cautious. But I asked about it last night in one of the XP forums and as you see got a contradictory reply:

 

> On my XP (SP3) PC I'm about to move 'My Documents' from C:\Docs to I:\Docs
> (about 500 GB).
>
> Will XP automatically edit the thousands of shortcut links to these files
> please?
>
> https://dl.dropboxusercontent.com/u/4019461/MyDocument-Changing-1.jpg
>

No. shortcuts will not be auto-modified. You would have to do it manually.


--
Dave
Multi-AV Scanning Tool - http://multi-av.thespykiller.co.uk
http://www.pctipp.ch/downloads/dl/35905.asp

I find it very surprising there aren't a range of programs to do this, given that it must be a fairly common and very tedious task. But if so then I suppose I'll have to resort to trying to use Macro Express Pro to tackle it. A quick search for LNK files found about 6,500 on my OS drive alone, and there will be several thousand more on other drives (excluding backups). So the idea of manually editing say 10,000 shortcuts is absurd!

 

--
Terry, East Grinstead, UK

Link to comment
Share on other sites

First off I must apologize as I skimmed over the fact you are using a 12 year old OS! Those instructions are for the last two versions of Windows, you're back 4. I think it's essentially the same. Find My Documents in My Computer and select the properties. Except the tab is called "Target" or something like that. I forget. And I don't think XP will move the content for you.

 

Next I never said it would update all the links I said that properly formed links would still work. But in checking I was wrong. There's is an environmental variable for your user profile %UserProfile% but not just "My Documents". EG if you have a file named test.txt a link to "%UserProfle%\documents\test.txt" works the same as "C:\documents and settings\Fred\documents\test.txt" I was remembering moving the entire user profile folder. I've done this several times before for clients. And actually this might be the better solution. But you should look to see what the actual paths are in the shortcuts. Just because one's supposed to use the environmental doesn't mean it's happening.

 

I looked online and there's a bunch of scripts and such to do this. Check out this one. Interestingly he uses a WSO.CreateShortcut method I was unaware of. I don't have a lot of time to search more but this PowerShell one was interesting as well. He too is not modifying but rather recreating them all. And if I were you I would not delete the old ones but rather cache them someplace or at least log all the paths in the LNK file in a text file along with the new LNK file's paths. This way if it fails you can write a script to back out your mistake and try again.

 

In any case sorry for the bad advice.

Link to comment
Share on other sites

On my XP (SP3) PC I'm about to move 'My Documents' (in some folders quaintly but confusingly called 'Terry's Documents') from C:\Docs to I:\Docs.

Consider using a symbolic link. This works by moving the object folder to, say, the D: drive (e.g. D:\My Documents), then telling the OS that C:\My Documents is actually located at D:\My Documents.

In a modern and supported OS like Windows 7, you can use the command Mklink. For XP, I'm not sure if that's the case. See this URL for more information:

http://superuser.com/questions/484061/how-to-create-an-ntfs-junction

Link to comment
Share on other sites

Thanks both. I'll get back into this tomorrow. The only reason I'm moving the 504 GB C:\Docs is because I'm down to 8% free space on the 750 GB C: drive. But if the shortcut issue proves as time-consuming as it is beginning to look, then I may re-consider and seek other options. For example, maybe I could compromise and just move the 160 GB C:\Docs\My Videos and drastically limit the number of affected shortcuts.

 

A macro that steps through a folder identifying LNK files, opens its Properties and then changes the target doesn't sound too difficult. Probably gets harder if a large number of sub-folders involved.

 

BTW, I soon expect to be ordering a new PC (which I'll run in parallel for a while). Given that I'm not into hi-tech media hardware, (I spend most of my time making videos), would you recommend Windows 7 or 8?

 

Edit Friday 20 September 2013, 09:02 UK time

 

Cory,

 

Pleased to report that the first script you suggested is looking good! Tested on a folder containing a small subset of my 10,000 and it worked OK. Next step will be to add a few subfolder levels.

 

Thanks for the lead.

 

--
Terry, East Grinstead, UK

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...