lubinski Posted September 10, 2008 Share Posted September 10, 2008 I have 2 things I want to accomplish with a VB script.1. I have pinned a shortcut to Microsoft Update to the start menu but it shows up as its .exe name "wupdmgr.exe" Is there a way to rename a pinned start menu item?2. This one is far off, is there a way to script the "changing" of a local users profile icon picture? E.g. the default is usually a fish or something, I want our company logo.Any help is appreciated. Link to comment Share on other sites More sharing options...
GreatBarrier86 Posted September 10, 2008 Share Posted September 10, 2008 I think that you can do it if you use the WScript.Shell method CreateShortcut. It allows you to set the shortcut name. Link to comment Share on other sites More sharing options...
Scr1ptW1zard Posted September 11, 2008 Share Posted September 11, 2008 For your first question, simply renaming the link should change the displayed name. This could easily be done with the rename command in a batch file, but here would be the vbscript way:Set fso = CreateObject("Scripting.FileSystemObject")Set WSHShell = WScript.CreateObject("WScript.Shell")StartMenu = WSHShell.SpecialFolders("StartMenu")OldLinkName="wupdmgr.exe.lnk"NewLinkName="New Name.lnk"if fso.fileexists(StartMenu + "\wupdmgr.exe.lnk") then set WUD=fso.GetFile(StartMenu + "\" + OldLinkName) WUD.Name=NewLinkNameend ifStartMenu=StartMenu + "\..\..\All Users\Start Menu"if fso.fileexists(StartMenu + "\wupdmgr.exe.lnk") then set WUD=fso.GetFile(StartMenu + "\" + OldLinkName) WUD.Name=NewLinkNameend ifYour second question would require a registry edit. Again, a batch file could perform this as well.Const HKLM = &H80000002strUserName="UserNameHere"strPirctureSource="D:\Images\MyImageFile.jpg"Set objRegistry = GetObject("Winmgmts:root\default:StdRegProv")sKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Hints\" + strUserNameobjRegistry.CreateKey HKLM, sKeyPathlRC=objRegistry.SetStringValue(HKLM, sKeyPath, "PictureSource", strPirctureSource)Hope that helps! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now