Microsoft 2000 Professional one-button macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
Put this line in the shortcut's 'Target'
%windir%\System32\rundll32.exe user32.dll,LockWorkStation

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| 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.
 
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<----------------------
 
Dave said:
Put this line in the shortcut's 'Target'
%windir%\System32\rundll32.exe user32.dll,LockWorkStation
Where can I find a list of all the functions available in user32.dll
(and others)? Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top