AllenAdministrator
(KiX Supporter)
2015-06-26 12:22 AM
Rename Desktop Shortcut without Moving its Physical Location

I have been renaming some desktop shortcuts and have come across a problem when it renames the files, it does not put the file back in its original location on the desktop. In other words, lets say the file is located in the upper right hand corner of the desktop. Upon rename, the file is moved to the first location available starting from the left.

Anyone have any ideas on how I might preserve the physical location data?


AllenAdministrator
(KiX Supporter)
2015-06-26 12:23 AM
Re: Rename Desktop Shortcut without Moving its Physical Location

Oh I tried using the built in Move, and shelling with REN. Both work to rename the file, but both move the files from the physical location on the desktop.

AllenAdministrator
(KiX Supporter)
2015-06-26 12:55 AM
Re: Rename Desktop Shortcut without Moving its Physical Location

I found the following utility that will save the layout of the desktop, but once I rename the file it won't know where to put it... even has command line options... sigh...

DesktopOK -
http://www.softwareok.com/?Freeware/DesktopOK


Glenn BarnasAdministrator
(KiX Supporter)
2015-06-26 01:40 AM
Re: Rename Desktop Shortcut without Moving its Physical Location

Gorilla Glue? \:D

AllenAdministrator
(KiX Supporter)
2015-06-26 01:49 AM
Re: Rename Desktop Shortcut without Moving its Physical Location

I got plenty of that in the synapse of my brain. Never thought to apply it the desktop... Wow, just realized I can use White out on the screen too. Fixed!

Glenn BarnasAdministrator
(KiX Supporter)
2015-06-26 04:42 AM
Re: Rename Desktop Shortcut without Moving its Physical Location

Wow - Glad I could help! \:D

AllenAdministrator
(KiX Supporter)
2015-06-29 07:02 PM
Re: Rename Desktop Shortcut without Moving its Physical Location

Do I have everyone stumped? Surely we can overcome this design flaw.

LonkeroAdministrator
(KiX Master Guru)
2015-06-29 08:00 PM
Re: Rename Desktop Shortcut without Moving its Physical Location

Wonder if shell-object would do it different...

AllenAdministrator
(KiX Supporter)
2015-06-29 11:28 PM
Re: Rename Desktop Shortcut without Moving its Physical Location

Do you mean Shell.Application and use the Verbs? If so I looked into that, but didnt find any examples to use the Rename Verb. In the past when I have used the verbs you picked the one you wanted and used .doit method.

LonkeroAdministrator
(KiX Master Guru)
2015-06-30 02:00 AM
Re: Rename Desktop Shortcut without Moving its Physical Location

 Code:
 $shell=createobject("shell.application")
 $file=$Shell.namespace($file).self
 $file.name = "new name.lnk"


Maybe?


AllenAdministrator
(KiX Supporter)
2015-06-30 02:47 AM
Re: Rename Desktop Shortcut without Moving its Physical Location

hmmmm...

AllenAdministrator
(KiX Supporter)
2015-06-30 04:18 AM
Re: Rename Desktop Shortcut without Moving its Physical Location

Didn't work, but you got me in the right direction... more to come. Thanks man. \:\)

AllenAdministrator
(KiX Supporter)
2015-06-30 11:33 PM
Re: Rename Desktop Shortcut without Moving its Physical Location

This little basta took a lot of time to get working properly. I doubt anyone will ever use it besides me, but posted to the UDFS. Enjoy.

RenameDesktopItem() -
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=210378#Post210378


NTDOCAdministrator
(KiX Master)
2015-07-01 02:36 AM
Re: Rename Desktop Shortcut without Moving its Physical Location

Great, thanks for sharing Allen. One never knows. Might not need it today but no one knows what the future holds. Always good to have an arsenal of tools and ideas available.