Advertisement
Najeebsk

CMDER.ahk

Dec 13th, 2023
1,367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;#Warn
  2. #NoEnv
  3. #SingleInstance, Force
  4. SetWorkingDir %A_ScriptDir%
  5. global winTitle
  6. winTitle := "ahk_class ConsoleWindowClass"
  7. Gui, -DPIScale
  8. Gui,Font,s12 CYellow,Lucida Console
  9. Gui,Color,Black, Black
  10. ;--------------------------
  11. List =
  12. (Ltrim Join|
  13. BOOKS\CHANNELS.txt
  14. BOOKS\CMD.txt
  15. BOOKS\COM.txt
  16. BOOKS\DOSKEY.ahk
  17. BOOKS\F.txt
  18. BOOKS\FFMPEG.txt
  19. BOOKS\FOLDER.txt
  20. BOOKS\HELP.txt
  21. BOOKS\I.txt
  22. BOOKS\MAGICK.txt
  23. BOOKS\MOVIES.txt
  24. BOOKS\N.txt
  25. YOUTUBE\BOOKS\NIRCMD.txt
  26. BOOKS\R.txt
  27. BOOKS\RAR.txt
  28. BOOKS\SEARCH-TEXT.au3
  29. BOOKS\SEARCH.txt
  30. BOOKS\SOFTWARES.ahk
  31. BOOKS\W.txt
  32. BOOKS\WEB.txt
  33. BOOKS\WGET.txt
  34. BOOKS\WHERE.txt
  35. BOOKS\WMIC.txt
  36. BOOKS\Y.txt
  37. BOOKS\YOUTUBE.txt
  38. )
  39. Gui,Font,s12 CYellow,Lucida Console
  40. Gui,Color,Black, Black
  41. Gui, Add, DropDownList, x10 y10 vFilePath gCMD2 w800, % List
  42. Gui, Add, DropDownList, x10 y40 vCmdDropdown gCMD w800
  43. Gui, Add, Edit, vCmdEdit x10 y80 w800 h60
  44. Gui, Add, Button, x10 y160 Default, Run Command
  45. Gui, Add, Button, x160 y160 gREF,REFRESH
  46. ; Add your predefined commands to the dropdown list
  47. ;Commands := "dir|ipconfig|ping|netstat|systeminfo|notepad"
  48.    
  49. Gui, Show, w820 h200 , NAJEEB CMD Command Runner
  50.  
  51. GuiDropFiles:
  52. Loop, parse, A_GuiEvent, `n
  53.    GuiControl,,FilePath,%A_LoopField%
  54. return
  55. CMD2:
  56.    Gui, Submit, NoHide
  57.     GuiControl, -Redraw, CmdDropdown ; Clear the dropdown list
  58.    
  59.     FileRead, Commands, %FilePath%
  60.     Loop, Parse, Commands, `n, `r
  61.     {
  62.         GuiControl,, CmdDropdown, %A_LoopField%
  63.     }
  64.    
  65.     GuiControl, +Redraw, CmdDropdown ; Redraw the dropdown list
  66. return
  67. GuiClose:
  68. ExitApp
  69. CMD:
  70. Gui, Submit, NoHide
  71. GuiControl,,CmdEdit, %CmdDropdown% ; Clear the dropdown list
  72. return  
  73.  
  74. ButtonRunCommand:
  75.    Gui, Submit, NoHide
  76.     SelectedCmd := CmdEdit       ;CmdDropdown
  77.  
  78.     if (SelectedCmd != "") {
  79.         ; Run the CMD command
  80.         RunWait, %ComSpec% /c %SelectedCmd%, , Hide
  81.     }
  82. return
  83. REF:
  84.    Gui, Submit, NoHide
  85. Reload
  86. return
  87. ;============ END SCRIPT ==============
  88. #R::Reload
  89. #S::Suspend
  90. #P::Pause
  91. #ESC::ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement