Jump to content

VB Script 2 Things


Recommended Posts

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


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=NewLinkName
end if

StartMenu=StartMenu + "\..\..\All Users\Start Menu"
if fso.fileexists(StartMenu + "\wupdmgr.exe.lnk") then
set WUD=fso.GetFile(StartMenu + "\" + OldLinkName)
WUD.Name=NewLinkName
end if

Your second question would require a registry edit. Again, a batch file could perform this as well.


Const HKLM = &H80000002

strUserName="UserNameHere"
strPirctureSource="D:\Images\MyImageFile.jpg"

Set objRegistry = GetObject("Winmgmts:root\default:StdRegProv")
sKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Hints\" + strUserName
objRegistry.CreateKey HKLM, sKeyPath
lRC=objRegistry.SetStringValue(HKLM, sKeyPath, "PictureSource", strPirctureSource)

Hope that helps!

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...