Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you use WSH to rename a shortcut but leave filename the same? 1

Status
Not open for further replies.

DROFNUD

MIS
Oct 16, 2001
40
GB

Basically I want to create a shortcut, with a filename that I can locate later for cleanup purposes, but with a different display name under explorer.

Using the script below, I get an Icon called RRDB1, whereas I would have liked it to be called "Master Database". The description property does not appear to work under NT4.
Code:
 set lnk = wsh.createShortcut( desktoppath & "\rrdb1.lnk" )
 lnk.targetPath       = "c:\rr\dbinit.vbs"
 lnk.description      = "Master Database"
 lnk.arguments        = sDBfilename
 lnk.workingDirectory = "c:\rr"
 lnk.save
IS there any way to perform the task of changing the display name? If I use fso.name then it renames the file, which is not what I want.

Cheers,
Simon...
 
Hello, DROFNUD.

My understanding is that the "Display Name" is exactly the shortcut filename minus the extension. In your example, it would be displayed as "rrdb1" on your desktop.

Best possible alternative is that you maintain a separate dictionary like :
rrdb1,Master Database
rrdb2,Secondary
... ,...
And create the lnk with its alias Display Name (Master Database). When clearup, look backward for its documented name (rrdb1).

If do not want to maintain a separate dictionary, then rather than
shortcut.Description = "Master Database"
shortcut.FullName = desktoppath & "\rrb1.lnk"

Switch them over so that your display name be "Master Database" for instance. But then, if you want to do maintanence work using rrb1, you have to scan through the shortcut ensemble for its description part to locate it.

Not much help, am afraid.

regards - tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top