[dba-Tech] I had no idea these existed!

Stuart McLachlan stuart at lexacorp.com.pg
Fri Mar 3 21:24:47 CST 2023


On 3 Mar 2023 at 17:31, Rocky Smolin wrote:

> Great link! I would like the Windows Shortcuts list as a pop-up.  That
> would be dope.
> 
> r

Save this as a .vbs file and open it (from a .lnk file  with its own hotkey :) ? )

Option Explicit
Dim objFSO: Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim WshShell: Set WshShell = WScript.CreateObject("WScript.Shell")
Dim arrFolders, objFolder, fldr, colfiles, colFolders
Dim objFile, objSubFolder, oShellLink, strHotKey

arrFolders = Array ( _
WshShell.SpecialFolders("AllUsersDesktop") _
, WshShell.SpecialFolders("Desktop") _
, WshShell.SpecialFolders("AllUsersStartMenu") _
, WshShell.SpecialFolders("StartMenu") _
, WshShell.SpecialFolders("AppData") & _
"\Microsoft\Internet Explorer\Quick Launch" _
)

For Each fldr In arrFolders
If objFSO.FolderExists (fldr) Then Call GetHotKeys (fldr)
Next

Sub GetHotKeys (strFolder)
Set objFolder = objFSO.GetFolder(strFolder)
Set colFiles = objFolder.Files
For Each objFile In colFiles
If LCase(objFSO.GetExtensionName(objFile.Name)) = "lnk" Then
Set oShellLink = WshShell.CreateShortcut(objFile.Path)
If Trim(oShellLink.Hotkey) <> "" Then
strHotKey = strHotKey & "[" & Trim(oShellLink.Hotkey) & _
"]" & vbCrLf & objFile.Path & vbCrLf & vbCrLf
End If
End If
Next
Set colFolders = objFolder.SubFolders
For Each objSubFolder In colFolders
GetHotKeys(objSubFolder)
Next
End Sub

WshShell.PopUp strHotKey,,"Hotkeys Curently in Use by Shortcuts", 65
Set WshShell = Nothing
Set objFSO = Nothing







More information about the dba-Tech mailing list