Advertisement
Najeebsk

WIN-INFO-ALL.py

Mar 31st, 2024 (edited)
690
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 12.78 KB | None | 0 0
  1. import subprocess
  2. import tkinter as tk
  3. from tkinter import ttk
  4. from tkinter import scrolledtext
  5. from tkinter import messagebox
  6. from tkinter import filedialog
  7. import os
  8.  
  9. # Create a Tkinter window
  10. window = tk.Tk()
  11. window.geometry("1000x680")
  12. window.configure(bg="#336699")
  13. window.title("Windows Information PC Management Tool")
  14.  
  15. # Function to execute shell commands
  16. def run_command(command):
  17.     try:
  18.         if command.startswith(('dir ', 'WHERE ', 'ping ', 'wmic ', 'assoc ', 'break ', 'call ', 'cd ', 'chdir ', 'cls ', 'color ', 'copy ', 'date ', 'del ', 'erase ', 'dir ', 'echo ', 'exit ', 'mkdir ', 'mklink ', 'move ', 'rd ', 'rmdir ', 'ren ', 'rename ', 'rmdir ', 'set ', 'setlocal ', 'shift ', 'start ', 'time ', 'title ', 'ver ', 'vol ', 'netsh ')):
  19.             # Use os.system for commands like dir, WHERE, ping, wmic, and cmd commands
  20.             result = os.popen(command).read()
  21.         elif command.startswith('help'):
  22.             # For 'help' command, execute 'cmd /c help' to get help info
  23.             result = subprocess.run(['cmd', '/c', 'help'], capture_output=True, text=True, check=True).stdout.strip()
  24.         else:
  25.             # Use subprocess.run for other commands
  26.             result = subprocess.run(command, capture_output=True, text=True, shell=True, check=True).stdout.strip()
  27.         return result
  28.     except subprocess.CalledProcessError as e:
  29.         messagebox.showerror("Error", f"Command failed: {e.stderr}")
  30.     except FileNotFoundError:
  31.         messagebox.showerror("Error", "Executable file not found. Please check your command.")
  32.     return None
  33.  
  34. # Function to display selected command result
  35. def execute_selected_command():
  36.     selected_command = command_options.get()
  37.     if selected_command:
  38.         output_text.delete(1.0, tk.END)  # Clear previous output
  39.         result = run_command(selected_command)
  40.         if result:
  41.             output_text.insert(tk.END, result)
  42.         else:
  43.             output_text.insert(tk.END, "No data available.")
  44.  
  45. # Function to execute custom command
  46. def execute_custom_command():
  47.     custom_command = custom_command_entry.get()
  48.     if custom_command:
  49.         output_text.delete(1.0, tk.END)  # Clear previous output
  50.         result = run_command(custom_command)
  51.         if result:
  52.             output_text.insert(tk.END, result)
  53.         else:
  54.             output_text.insert(tk.END, "No data available.")
  55.     else:
  56.         messagebox.showwarning("Warning", "Please enter a command.")
  57.  
  58. # Function to clear the output text field
  59. def clear_output():
  60.     output_text.delete(1.0, tk.END)
  61.  
  62. # Function to save displayed result to a text file
  63. def save_result():
  64.     result = output_text.get(1.0, tk.END)
  65.     if result.strip():
  66.         file_path = filedialog.asksaveasfilename(defaultextension=".txt", filetypes=[("Text files", "*.txt")])
  67.         if file_path:
  68.             with open(file_path, "w") as file:
  69.                 file.write(result)
  70.                 messagebox.showinfo("Success", "Result saved successfully.")
  71.     else:
  72.         messagebox.showwarning("Warning", "No data to save.")
  73.  
  74. # Function to show help.txt
  75. def show_help():
  76.     # Save help information to Help.txt file
  77.     #run_command('Help >> Help.txt')
  78.     # Read help information from file
  79.     with open("Help.txt", "r") as file:
  80.         help_text = file.read()
  81.     if help_text:
  82.         output_text.delete(1.0, tk.END)
  83.         output_text.insert(tk.END, help_text)
  84.     else:
  85.         output_text.delete(1.0, tk.END)
  86.         output_text.insert(tk.END, "No help available.")
  87.  
  88. # Function to delete help.txt
  89. def delete_help_file():
  90.     try:
  91.         os.remove("Help.txt")
  92.         messagebox.showinfo("Success", "Help.txt deleted successfully.")
  93.     except FileNotFoundError:
  94.         messagebox.showwarning("Warning", "Help.txt not found.")
  95.  
  96. # Dropdown list of commands
  97. commands = [
  98.     # NAJEEB PC TOOLS
  99.     "--[NAJEEB PC TOOLS]--",
  100.     "Everything.exe -?",
  101.     "Everything.exe -search Najeeb",
  102.     "ES.exe -a jpg",
  103.     "START C:\CMDER\TOOLS\LIST.pyw",
  104.     "START C:\CMDER\TOOLS\RENAME-EXT.pyw",
  105.     "START C:\CMDER\TOOLS\ALL-RADIOS.pyw",
  106.     "START C:\CMDER\TOOLS\TOOL.ahk",
  107.     "START C:\CMDER\SOFT\SOFT.ahk",
  108.     "START C:\CMDER\APP\APPS.ahk",
  109.     "START C:\CMDER\TOOLS\TOOLS.txt",
  110.     "START C:\CMDER\SOFT\SOFT.txt",
  111.     "START C:\CMDER\APP\APP.txt",
  112.     "START C:\CMDER\HOME.ahk",
  113.     "START C:\CMDER\TOOLS.ahk",
  114.     "START C:\CMDER\COMMANDER.ahk",
  115.     "START C:\CMDER\CMDR.ahk",
  116.     "START C:\CMDER\CMD.ahk",
  117.     "START C:\CMDER\FFMPEG.ahk",
  118.     "START C:\CMDER\AHK.ahk",
  119.    
  120.     # NAJEEB PC INFORMATION
  121.     "--[NAJEEB PC INFORMATION]--",
  122.     "systeminfo",
  123.     "msinfo32",
  124.     "DOSKEY /?",
  125.     "START C:/CMDER/BOOK.py",
  126.     "compmgmt.msc",
  127.     "diskmgmt.msc",
  128.     "devmgmt.msc",
  129.     "Control Panel",
  130.     "START shell:AppData",
  131.     "START shell:Startup",
  132.     "START shell:ProgramFiles",
  133.     "START C:/Users/Najeeb/AppData/Local/Temp",
  134.     "START C:\Windows\Prefetch",
  135.     "START C:\Windows\Temp",
  136.     "TZUTIL /L",
  137.     "TZUTIL /G",
  138.     'TZUTIL /S "Pakistan Standard Time"',
  139.     "getmac",
  140.     "ipconfig /all",
  141.     "net share",
  142.     "netstat -ao",
  143.     "net view",
  144.     "arp -a",
  145.     "ipconfig /displaydns",
  146.     "tracert www.google.com",
  147.     "tasklist",
  148.     "whoami",
  149.     "whoami /priv",
  150.     "net user",
  151.     "cmdkey /list",
  152.     'dir "C:\\Program Files" >> Help.txt',
  153.     'dir /S /B /A "C:\\" >> Help.txt',
  154.     'dir /S /B /A "D:\\" >> Help.txt',
  155.     'dir /S /B /A "E:\\" >> Help.txt',
  156.     'dir /S /B /A "F:\\" >> Help.txt',
  157.     'dir /S /B /A "G:\\" >> Help.txt',
  158.     # COMMANDS ALL BOOKS
  159.     "--[COMMANDS ALL BOOKS]--",
  160.     "START C:\CMDER\BOOKS.pyw",
  161.     "START C:\CMDER\BOOKS\BATCH.txt",
  162.     "START C:\CMDER\BOOKS\CHANNELS.txt",
  163.     "START C:\CMDER\BOOKS\CMD.txt",
  164.     "START C:\CMDER\BOOKS\CMD2.txt",
  165.     "START C:\CMDER\BOOKS\CMDER.txt",
  166.     "START C:\CMDER\BOOKS\COM.txt",
  167.     "START C:\CMDER\BOOKS\DOSKEY.txt",
  168.     "START C:\CMDER\BOOKS\DOSKEY-HELP.txt",
  169.     "START C:\CMDER\BOOKS\ENVIRONMENTAL-VARIABLES.txt",
  170.     "START C:\CMDER\BOOKS\EVERYTHING.txt",
  171.     "START C:\CMDER\BOOKS\FFMPEG.txt",
  172.     "START C:\CMDER\BOOKS\FOLDER.txt",
  173.     "START C:\CMDER\BOOKS\INFO.txt",
  174.     "START C:\CMDER\BOOKS\MAGICK.txt",
  175.     "START C:\CMDER\BOOKS\MOVIES.txt",
  176.     "START C:\CMDER\BOOKS/NIRCMD.txt",
  177.     "START C:\CMDER\BOOKS\PYTHON.txt",
  178.     "START C:\CMDER\BOOKS\RAR.txt",
  179.     "START C:\CMDER\BOOKS\SEARCH.txt",
  180.     "START C:\CMDER\BOOKS\TOOLS.txt",
  181.     "START C:\CMDER\BOOKS\WEB.txt",
  182.     "START C:\CMDER\BOOKS\WGET.txt",
  183.     "START C:\CMDER\BOOKS\WHERE.txt",
  184.     "START C:\CMDER\BOOKS\WMIC.txt",
  185.     "START C:\CMDER\BOOKS\YOUTUBE.txt",
  186.     # NIRCMD Commands
  187.     "--[NIRCMD Commands]--",
  188.     "nircmd.exe emptybin & Exit",
  189.     "nircmd.exe mutesysvolume 1",
  190.     "nircmd.exe mutesysvolume 0",
  191.     'nircmd.exe loop 10 60000 savescreenshot "~$folder.desktop$\P~$loopcount$.png" & Exit',
  192.    
  193.     # WGET ALL COMMANDS
  194.     "--[WGET ALL COMMANDS]--",
  195.     "wget --help",
  196.     "wget http://nwhiker.com/wallpaper/wp06.jpg",
  197.     "wget -O Download\1.jpg http://nwhiker.com/wallpaper/wp07.jpg",
  198.     "wget -b http://nwhiker.com/wallpaper/wp08.jpg",
  199.     "wget --limit-rate=100 http://nwhiker.com/wallpaper/wp09.jpg",
  200.     "wget -c http://nwhiker.com/wallpaper/wp01.jpg",
  201.     "wget -i download_list.txt",
  202.     # WHERE ALL COMMANDS
  203.     "--[WHERE ALL COMMANDS]--",
  204.     "WHERE /?",
  205.     'WHERE /R "c:\\windows" *.exe *.dll *.bat',
  206.     'WHERE /R C:\\ /F *.exe',
  207.     'WHERE notepad.exe > Help.txt',
  208.     "WHERE.exe cmd",
  209.     "WHERE.exe *.exe",
  210.     "WHERE.exe /R C:\Windows *.exe",
  211.     "WHERE.exe some_command && echo Command exists || echo Command does not exist",
  212.     "WHERE.exe python.exe",
  213.     "WHERE.exe *.bat",
  214.     "WHERE.exe *.dll",
  215.     "WHERE.exe /R . *.exe",
  216.     "WHERE.exe ipconfig.exe",
  217.     'WHERE.exe /R "C:\\Program Files" *.exe'
  218.     "WHERE.exe *VIDEOS*",
  219.     # NETSH ALL COMMANDS
  220.     "--[NETSH ALL COMMANDS]--",
  221.     "netsh /?",
  222.     "netsh interface ipv4 show config",
  223.     "netsh wlan export profile folder=. key=clear",
  224.     "netsh interface ipv6 show interfaces",
  225.     "netsh advfirewall show allprofiles",
  226.     "netsh advfirewall firewall show rule name=all",
  227.     "netsh interface show interface",
  228.     "netsh wlan show networks",
  229.     "netsh wlan show drivers",
  230.     "netsh winhttp show proxy",
  231.     "netsh interface tcp show global",
  232.     "netsh interface udp show global",
  233.     "netsh show alias",
  234.     "ping -n 30 google.com",
  235.     "--[WMIC ALL COMMANDS]--",
  236.     # WMIC ALL COMMANDS
  237.     "wmic /?",
  238.     "wmic computersystem list full",
  239.     "wmic startup list full",
  240.     "wmic context",
  241.     "wmic qfe list",
  242.     "wmic product get name",
  243.     'wmic qfe list | find /c /v ""',
  244.     "wmic cpu get numberofcores",
  245.     'wmic process where ExecutablePath="C:\\windows\\system32\\notepad.exe" get ProcessId',
  246.     "wmic bios get version",
  247.     "wmic csproduct get name",
  248.     "wmic process list",
  249.     "wmic process get ProcessID,ExecutablePath",
  250.     "wmic CPU Get DeviceID,NumberOfCores,NumberOfLogicalProcessors",
  251.     "wmic systemslot get slotdesignation,currentusage,description,status",
  252.     "wmic temperature get deviceid,name,status",
  253.     "wmic port get name",
  254.     "wmic bios get serialnumber",
  255.     "wmic cpu get name",
  256.     "wmic os get caption",
  257.     "wmic logicaldisk get caption,description",
  258.     "wmic nic get name,MACAddress",
  259.     "wmic nicconfig get IPAddress,DefaultIPGateway",
  260.     "WMIC os list brief",
  261.     "WMIC product list brief",
  262.     "WMIC diskdrive get model,name,size",
  263.     "WMIC OS GET localdatetime",
  264.     "wmic os get version",
  265.     # CMD Commands
  266.     "--[CMD Commands]--",
  267.     "Help >> Help.txt",
  268.     "assoc /? >> Help.txt",
  269.     "attrib /? >> Help.txt",
  270.     "break /? >> Help.txt",
  271.     "call /? >> Help.txt",
  272.     "cd /? >> Help.txt",
  273.     "chdir /? >> Help.txt",
  274.     "cls /? >> Help.txt",
  275.     "color /? >> Help.txt",
  276.     "copy /? >> Help.txt",
  277.     "DISKPART",
  278.     "date /? >> Help.txt",
  279.     "del /? >> Help.txt",
  280.     "erase /? >> Help.txt",
  281.     "dir /? >> Help.txt",
  282.     "echo /? >> Help.txt",
  283.     "exit /? >> Help.txt",
  284.     "md /? >> Help.txt",
  285.     "mkdir /? >> Help.txt",
  286.     "mklink /? >> Help.txt",
  287.     "move /? >> Help.txt",
  288.     "rd /? >> Help.txt",
  289.     "rmdir /? >> Help.txt",
  290.     "ren /? >> Help.txt",
  291.     "rename /? >> Help.txt",
  292.     "rmdir /? >> Help.txt",
  293.     "set /? >> Help.txt",
  294.     "setlocal /? >> Help.txt",
  295.     "shift /? >> Help.txt",
  296.     "start /? >> Help.txt",
  297.     "time /? >> Help.txt",
  298.     "title /? >> Help.txt",
  299.     "ver/? >> Help.txt",
  300.     "vol /? >> Help.txt"
  301.     # OTHER Commands
  302.     "--[OTHER Commands]--",
  303.     "FFMPEG -h",
  304.     "youtube-dl -h",
  305.     "magick -help",
  306.     "wget --help",
  307. ]
  308.  
  309. # Create dropdown list
  310. command_options = ttk.Combobox(window, values=commands, state="readonly", width=74, font=("Arial", 12))
  311. command_options.grid(row=1, column=0, padx=10, pady=(10, 5))
  312.  
  313. # Entry field for custom command
  314. custom_command_entry = tk.Entry(window, width=74, font=("Arial", 12))
  315. custom_command_entry.grid(row=2, column=0, padx=10, pady=5)
  316.  
  317. # Button to execute selected command
  318. execute_button = tk.Button(window, text="Execute Seleted Command", command=execute_selected_command, fg="White", bg="Blue")
  319. execute_button.grid(row=1, column=1, padx=10, pady=(10, 5), sticky="w")
  320.  
  321. # Button to execute custom command
  322. execute_custom_button = tk.Button(window, text="Execute Custom Command", command=execute_custom_command, fg="White", bg="Blue")
  323. execute_custom_button.grid(row=2, column=1, padx=10, pady=5, sticky="w")
  324.  
  325. # Button to clear output
  326. clear_button = tk.Button(window, text="Clear", command=clear_output, fg="white", bg="Red")
  327. clear_button.grid(row=1, column=2, padx=10, pady=(10, 5), sticky="w")
  328.  
  329. # Button to save result
  330. save_button = tk.Button(window, text="Save Result", command=save_result, fg="white", bg="Green")
  331. save_button.grid(row=1, column=3, padx=10, pady=(10, 5), sticky="w")
  332.  
  333. # Button to show help.txt
  334. help_button = tk.Button(window, text="Show Help", command=show_help, fg="black", bg="yellow")
  335. help_button.grid(row=1, column=4, padx=10, pady=(10, 5), sticky="w")
  336.  
  337. # Button to delete help.txt
  338. delete_help_button = tk.Button(window, text="Delete Help", command=delete_help_file, fg="black", bg="orange")
  339. delete_help_button.grid(row=2, column=4, padx=10, pady=5, sticky="w")
  340.  
  341. # Text field to display output
  342. output_text = scrolledtext.ScrolledText(window, width=107, height=28, wrap=tk.WORD, font=("Arial", 12))
  343. output_text.grid(row=3, column=0, columnspan=5, padx=10, pady=10, sticky="nsew")
  344.  
  345. # Label for the heading
  346. heading_label = tk.Label(window, text="NAJEEB ALL PC INFORMATION", font=("Arial", 24, "bold"), bg="#336699", fg="white")
  347. heading_label.grid(row=0, column=0, columnspan=5, pady=(5, 10))
  348.  
  349. # Configure grid weights to make the text field expandable
  350. window.grid_columnconfigure(0, weight=1)
  351. window.grid_rowconfigure(3, weight=1)
  352.  
  353. # Run the Tkinter event loop
  354. window.mainloop()
  355.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement