Advertisement
Guest User

WinX_AllOS.ahk

a guest
May 20th, 2016
509
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;Copyright (c) 2016
  2. ;
  3. ;Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
  4. ;documentation files (the "Software"), to deal in the Software without restriction, including without limitation
  5. ;the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
  6. ;to permit persons to whom the Software is furnished to do so, subject to the following conditions:
  7. ;
  8. ;The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
  9. ;
  10. ;THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
  11. ;TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  12. ;THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
  13. ;CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  14. ;DEALINGS IN THE SOFTWARE.
  15.  
  16. #SingleInstance force
  17. SetFormat, Floatfast, 0.2
  18.  
  19. isXP := false
  20. isW8 := false
  21. isW10 := false
  22. winVer := A_OSVersion
  23. w10Pos := InStr(winVer,10.)
  24. if winVer = WIN_XP
  25.     isXP := true
  26. else if (winVer = "WIN_8" or winVer = "WIN_8.1")
  27.     isW8 := true
  28. else if (w10Pos > 0)
  29.     isW10 := true
  30.  
  31. Menu, ShutdownMenu, Add, Sign Out, SignOut
  32. Menu, ShutdownMenu, Add, Sleep, MenuSleep
  33. Menu, ShutdownMenu, Add, Shutdown, MenuShutdown
  34. Menu, ShutdownMenu, Add, Restart, MenuRestart
  35.  
  36. Menu, StandardMenu, Add, Programs and Features, ProgramsAndFeatures
  37. Menu, StandardMenu, Add, Power Options, PowerOptions
  38. Menu, StandardMenu, Add, Event Viewer, EventViewer
  39. Menu, StandardMenu, Add, System, System
  40. Menu, StandardMenu, Add, Device Manager, DeviceManager
  41. Menu, StandardMenu, Add, Network Connections, NetworkConnections
  42. Menu, StandardMenu, Add, Disk Management, DiskManagement
  43. Menu, StandardMenu, Add, Computer Management, ComputerManagement
  44. Menu, StandardMenu, Add, Command Prompt, CommandPrompt
  45. Menu, StandardMenu, Add, Command Prompt (Admin), CommandPromptAdmin
  46. Menu, StandardMenu, Add,
  47. Menu, StandardMenu, Add, Task Manager, TaskManager
  48. Menu, StandardMenu, Add, Control Panel, ControlPanel
  49. Menu, StandardMenu, Add, File Explorer, FileExplorer
  50. Menu, StandardMenu, Add, Search, Search
  51. Menu, StandardMenu, Add, Run, MenuRun
  52. Menu, StandardMenu, Add,
  53. Menu, StandardMenu, Add, Shut down or sign out, :ShutdownMenu
  54. Menu, StandardMenu, Add, Desktop, Desktop
  55.  
  56. #x::
  57.     ShowMenu()
  58. return
  59.  
  60. ShowMenu()
  61. {
  62.     Menu, StandardMenu, Show,
  63. }
  64.  
  65. NotWorking()
  66. {
  67.     ;not functioning right now
  68.     TrayTip,, This function doesn't work currently, 10
  69. }
  70.  
  71. RunAsAdmin(command, params:="", wait := false)
  72. {
  73.     DllCall("Wow64DisableWow64FsRedirection", "uint*", OldValue)
  74.     if wait
  75.         RunWait,  *runas %command% %params%
  76.     else
  77.         Run, *runas %command% %params%
  78.     DllCall("Wow64RevertWow64FsRedirection", "uint", OldValue)
  79.     return
  80. }
  81.  
  82. Run(params, wait := false)
  83. {
  84.     toRun = %comspec% /c "%params%"
  85.     if wait
  86.         RunWait, %toRun%
  87.     else
  88.         Run, %toRun%
  89.     return
  90. }
  91.  
  92. Restart(timewait)
  93. {
  94.     Run, shutdown /r /t %timewait%
  95. }
  96.  
  97. ProgramsAndFeatures:
  98.     Run, appwiz.cpl
  99. return
  100.  
  101. PowerOptions:
  102.     Run, powercfg.cpl
  103. return
  104.  
  105. EventViewer:
  106.     Run, eventvwr.exe
  107. return
  108.  
  109. System:
  110.     if isXP = true
  111.         Run, control sysdm.cpl
  112.     else
  113.         Run, control /name Microsoft.System
  114. return
  115.  
  116. DeviceManager:
  117.     Run, devmgmt.msc
  118. return
  119.  
  120. NetworkConnections:
  121.     Run, control netconnections
  122. return
  123.  
  124. DiskManagement:
  125.     Run, diskmgmt.msc
  126. return
  127.  
  128. ComputerManagement:
  129.     Run, compmgmt.msc
  130. return
  131.  
  132. CommandPrompt:
  133.     Run, %windir%\system32\cmd.exe
  134. return
  135.  
  136. CommandPromptAdmin:
  137.     RunAsAdmin(comspec)
  138. return
  139.  
  140. TaskManager:
  141.     Run, taskmgr.exe
  142. return
  143.  
  144. ControlPanel:
  145.     Run, control
  146. return
  147.  
  148. FileExplorer:
  149.     Run, explorer.exe
  150. return
  151.  
  152. Search:
  153.     ;sketchy way to search
  154.     Run, cmd /c echo CreateObject("Shell.Application").FindFiles >%temp%\myff.vbs & cscript.exe //Nologo %temp%\myff.vbs & del %temp%\mff.vbs
  155. return
  156.  
  157. MenuRun:
  158.     Run, explorer.exe Shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}
  159. return
  160.  
  161. SignOut:
  162.     Run, shutdown /l /t 0
  163. return
  164.  
  165. MenuSleep:
  166.     NotWorking()
  167. return
  168.  
  169. MenuShutdown:
  170.     Run, shutdown /s /t 0
  171. return
  172.  
  173. MenuRestart:
  174.     Run, shutdown /r /t 0
  175. return
  176.  
  177. Desktop:
  178.     WinMinimizeAll
  179. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement