Pages

adds fast shutdown icon to your desktop

Sunday 25 May 2014
code:
Set Shell = CreateObject("WScript.Shell")
DesktopPath = Shell.SpecialFolders("Desktop")

' Add Shutdown link to the desktop
Set linkShutdown = Shell.CreateShortcut(DesktopPath & "\Shutdown.lnk")
linkShutdown.Arguments = "-s -t 00"
linkShutdown.Description = "Shutdown the computer"
linkShutdown.IconLocation = ("%SystemRoot%\system32\SHELL32.dll,27")
linkShutdown.TargetPath = "shutdown"
linkShutdown.WindowStyle = 1
linkShutdown.WorkingDirectory = "%windir%"
linkShutdown.Save

' Add restart link to the desktop
Set linkRestart = Shell.CreateShortcut(DesktopPath & "\Restart.lnk")
linkRestart.Arguments = "-r -t 00"
linkRestart.Description = "Restart the computer"
linkRestart.IconLocation = ("%SystemRoot%\system32\SHELL32.dll,146")
linkRestart.TargetPath = "shutdown"
linkRestart.WindowStyle = 1
linkRestart.WorkingDirectory = "%windir%"
linkRestart.Save

' Add logoff link to the desktop
Set linkLogoff = Shell.CreateShortcut(DesktopPath & "\Logoff.lnk")
linkLogoff.Arguments = "-l -t 00"
linkLogoff.Description = "Log off the computer"
linkLogoff.IconLocation = ("%SystemRoot%\system32\SHELL32.dll,44")
linkLogoff.TargetPath = "shutdown"
linkLogoff.WindowStyle = 1
linkLogoff.WorkingDirectory = "%windir%"

linkLogoff.Save

No comments:

Post a Comment