wnfisba said:
Is there any way that I can create a one-button visual macro that will lock
my computer???
Rather than...
<CTRL><ALT><DELETE>
<CTRL><K>
Can I somehow put these commands into a macro and then execute the macro
with an i-con that sits in my system tray???
Thanks in advance for your help and guidance.
Hi,
Below is a VBScript that creates two shortcuts named Lock
Workstation, one on the quick launch tray for the current user,
and one in the All Users Desktop folder. It uses the padlock
icon in Shell32.dll as shortcut icon.
Put the following in a .vbs file and double click on it:
'--------------------8<----------------------
Set oShell = CreateObject("WScript.Shell")
sWinSysDir = oShell.ExpandEnvironmentStrings("%SystemRoot%\System32")
' Create shortcut in the Quick Launch tray
sCurrUsrPath = oShell.ExpandEnvironmentStrings("%UserProfile%")
Set oShortCut = oShell.CreateShortcut(sCurrUsrPath _
& "\Application Data\Microsoft\Internet Explorer\" _
& "Quick Launch\Lock Workstation.lnk")
oShortCut.TargetPath = sWinSysDir & "\Rundll32.exe"
oShortCut.Arguments = "User32.dll,LockWorkStation"
oShortCut.IconLocation = sWinSysDir & "\Shell32.dll,47"
oShortCut.Save
' Create shortcut in the All Users Desktop folder
sAllUsersDesktopPath = oShell.SpecialFolders("AllUsersDesktop")
Set oShortCut = oShell.CreateShortcut( _
sAllUsersDesktopPath & "\Lock Workstation.lnk")
oShortCut.TargetPath = sWinSysDir & "\Rundll32.exe"
oShortCut.Arguments = "User32.dll,LockWorkStation"
oShortCut.IconLocation = sWinSysDir & "\Shell32.dll,47"
oShortCut.Save
MsgBox "Lock Workstation shortcuts are now created.", _
vbInformation + vbSystemModal, "Create shortcuts"
'--------------------8<----------------------