I would think the same as changing any other file name...
i.e.
Code:
Option Explicit
Dim objFSO : Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim objFile : Set objFile = objFSO.GetFile("C:\temp\SomeShortcut.lnk")
objFile.Name = "SomeShortcut_Renamed.lnk"
--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
so where do I fit this in?
Set objFileSys = CreateObject("Scripting.Filesystemobject")
Set objShell = WScript.CreateObject("WScript.Shell")
strStartMenu = objShell.SpecialFolders("AllUsersStartMenu")
If Not objFileSys.FileExists("c:\Program Files\Microsoft Office\OFFICE11\OIS.EXE") Then wscript.quit(1)
If Not objFileSys.FileExists(strStartMenu & "\Microsoft Picture Manager.lnk") Then
Set objShortcut = objShell.CreateShortcut(strStartMenu & "\Microsoft Picture Manager.lnk")
objShortcut.TargetPath = "c:\Program Files\Microsoft Office\OFFICE11\OIS.EXE"
objShortcut.WindowStyle = 1
objShortcut.IconLocation = "c:\Program Files\Microsoft Office\OFFICE11\OIS.EXE, 0"
objShortcut.WorkingDirectory = "c:\Program Files\Microsoft Office\OFFICE11\"
objShortcut.Save
End If
Set objFileSys = Nothing
Set objShell = Nothing
wscript.quit(0)
It looks like you're creating the shortcut with the code you posted...just name it what it should be. If there already exists a shortcut with a different name and you know what it is...then use the code I previously posted.
--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.