Compare commits
17 Commits
d3b0683c64
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| b6c3efac3e | |||
| fd295b86fa | |||
| 19503890ce | |||
| 7ea9375028 | |||
| aafb27e777 | |||
| bbf1476da3 | |||
| 096842200d | |||
| 463a8e32cc | |||
| 3517d27664 | |||
| e1bd16b992 | |||
| 8c3d2dcab1 | |||
| 5153ea40c2 | |||
| d99d4aecf3 | |||
| 26c93bee0f | |||
| dd35d902a7 | |||
| 0467d8ec48 | |||
| b67a966e01 |
14
README.md
14
README.md
@@ -1,18 +1,14 @@
|
||||
# Batchr
|
||||
Batch scripts are simple text files (with .bat or .cmd extensions) containing a sequence of Windows command-line instructions. They automate repetitive tasks like file management, program launches, or system configurations by executing commands sequentially via the Command Prompt.
|
||||
# HyperCLI - Next-Gen Command Executor
|
||||
All-in-one scripts for Windows, macOS, Linux, and servers.
|
||||
|
||||
### Menu Launcher
|
||||
Windows 10/11
|
||||
```
|
||||
cmd /c "curl -L https://git.weektab.org/companas/Batchr/raw/branch/main/batchr.bat -o %TEMP%\batchr.bat && start /wait %TEMP%\batchr.bat & del %TEMP%\batchr.bat"
|
||||
curl -L https://git.weektab.org/nexus/HyperCLI/raw/branch/main/menu-launcher.bat -o %TEMP%\menu-launcher.bat && start /wait %TEMP%\menu-launcher.bat & del %TEMP%\menu-launcher.bat
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> The scripts were created and verified by __Weektab__. To run the Menu Launcher, please open the Command Prompt (CMD) and enter the Menu Launcher there.
|
||||
>
|
||||
> You can also press the `Win + R` keys to open the “Run” dialog, type `cmd` and then enter the command in the Command Prompt.
|
||||
|
||||
> [!TIP]
|
||||
> Please do not enter the Menu Launcher directly in the “Run” dialog, as Windows Defender may interpret it as a potential system threat.
|
||||
> The scripts were developed and tested by __Weektab__. To use the Menu Launcher, select the version for your operating system and run it from the command prompt.
|
||||
|
||||
> [!IMPORTANT]
|
||||
> External scripts from third-party providers are tested and also listed in order to expand the list and tools of the menu launcher.
|
||||
|
||||
422
files/experimental/nmap.bat
Normal file
422
files/experimental/nmap.bat
Normal file
@@ -0,0 +1,422 @@
|
||||
@echo off
|
||||
REM === Interactive Nmap Scanner Tool ===
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
echo ========================================
|
||||
echo Nmap Network Scanner Tool
|
||||
echo ========================================
|
||||
echo.
|
||||
|
||||
REM Check if Nmap is installed
|
||||
where nmap >nul 2>nul
|
||||
if %ERRORLEVEL% NEQ 0 (
|
||||
echo Nmap is not installed on this system.
|
||||
echo.
|
||||
set /p INSTALL="Do you want to install Nmap? (Y/N): "
|
||||
|
||||
if /i "!INSTALL!"=="Y" (
|
||||
echo.
|
||||
echo Opening Nmap download page in your browser...
|
||||
echo Please download and install Nmap from: https://nmap.org/download.html
|
||||
echo After installation, restart this script.
|
||||
start https://nmap.org/download.html
|
||||
echo.
|
||||
pause
|
||||
exit /b 0
|
||||
) else (
|
||||
echo.
|
||||
echo Nmap installation cancelled. Exiting...
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
)
|
||||
|
||||
echo Nmap is installed!
|
||||
echo.
|
||||
|
||||
REM Prompt for target
|
||||
set /p TARGET="Enter target IP address or domain: "
|
||||
|
||||
REM Validate input
|
||||
if "%TARGET%"=="" (
|
||||
echo.
|
||||
echo ERROR: No target specified!
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
REM Display scan options
|
||||
:MENU
|
||||
echo.
|
||||
echo ========================================
|
||||
echo Select Scan Type:
|
||||
echo ========================================
|
||||
echo.
|
||||
echo [1] Port Scan
|
||||
echo [2] Host Discovery (Ping Scan)
|
||||
echo [3] OS Detection
|
||||
echo [4] Stealth Scan (SYN Scan)
|
||||
echo [5] Aggressive Scan
|
||||
echo [6] UDP Scan
|
||||
echo [7] Script Scan (NSE)
|
||||
echo [8] Save Results to File
|
||||
echo [9] Custom Command
|
||||
echo.
|
||||
echo [0] Exit
|
||||
echo.
|
||||
set /p SCANTYPE="Select scan type (0-9): "
|
||||
|
||||
if "%SCANTYPE%"=="0" (
|
||||
echo.
|
||||
echo Exiting...
|
||||
exit /b 0
|
||||
)
|
||||
|
||||
echo.
|
||||
echo ========================================
|
||||
|
||||
REM Execute scan based on selection
|
||||
if "%SCANTYPE%"=="1" goto PORT_SCAN
|
||||
if "%SCANTYPE%"=="2" goto HOST_DISCOVERY
|
||||
if "%SCANTYPE%"=="3" goto OS_DETECTION
|
||||
if "%SCANTYPE%"=="4" goto STEALTH_SCAN
|
||||
if "%SCANTYPE%"=="5" goto AGGRESSIVE_SCAN
|
||||
if "%SCANTYPE%"=="6" goto UDP_SCAN
|
||||
if "%SCANTYPE%"=="7" goto SCRIPT_SCAN
|
||||
if "%SCANTYPE%"=="8" goto SAVE_RESULTS
|
||||
if "%SCANTYPE%"=="9" goto CUSTOM_COMMAND
|
||||
|
||||
echo ERROR: Invalid selection! Please choose 0-9.
|
||||
goto MENU
|
||||
|
||||
:PORT_SCAN
|
||||
echo PORT SCAN OPTIONS
|
||||
echo ========================================
|
||||
echo [1] Scan top 1000 common ports (fast)
|
||||
echo [2] Scan all 65535 ports (slow)
|
||||
echo [3] Scan specific port
|
||||
echo [4] Scan port range
|
||||
echo [5] Fast scan (top 100 ports)
|
||||
echo.
|
||||
set /p PORTSCAN="Select port scan option: "
|
||||
echo.
|
||||
|
||||
if "%PORTSCAN%"=="1" (
|
||||
echo Command: nmap %TARGET%
|
||||
echo.
|
||||
nmap %TARGET%
|
||||
goto SCAN_DONE
|
||||
)
|
||||
if "%PORTSCAN%"=="2" (
|
||||
echo Command: nmap -p- %TARGET%
|
||||
echo.
|
||||
nmap -p- %TARGET%
|
||||
goto SCAN_DONE
|
||||
)
|
||||
if "%PORTSCAN%"=="3" (
|
||||
set /p PORT="Enter port number: "
|
||||
echo Command: nmap -p !PORT! %TARGET%
|
||||
echo.
|
||||
nmap -p !PORT! %TARGET%
|
||||
goto SCAN_DONE
|
||||
)
|
||||
if "%PORTSCAN%"=="4" (
|
||||
set /p PORTRANGE="Enter port range (e.g., 1-1000): "
|
||||
echo Command: nmap -p !PORTRANGE! %TARGET%
|
||||
echo.
|
||||
nmap -p !PORTRANGE! %TARGET%
|
||||
goto SCAN_DONE
|
||||
)
|
||||
if "%PORTSCAN%"=="5" (
|
||||
echo Command: nmap -F %TARGET%
|
||||
echo.
|
||||
nmap -F %TARGET%
|
||||
goto SCAN_DONE
|
||||
)
|
||||
echo Invalid option!
|
||||
goto MENU
|
||||
|
||||
:HOST_DISCOVERY
|
||||
echo HOST DISCOVERY OPTIONS
|
||||
echo ========================================
|
||||
echo [1] Ping scan only (check if host is up)
|
||||
echo [2] No ping (assume host is up and scan)
|
||||
echo [3] TCP SYN discovery on port 80
|
||||
echo [4] ICMP echo discovery
|
||||
echo.
|
||||
set /p HOSTSCAN="Select host discovery option: "
|
||||
echo.
|
||||
|
||||
if "%HOSTSCAN%"=="1" (
|
||||
echo Command: nmap -sn %TARGET%
|
||||
echo.
|
||||
nmap -sn %TARGET%
|
||||
goto SCAN_DONE
|
||||
)
|
||||
if "%HOSTSCAN%"=="2" (
|
||||
echo Command: nmap -Pn %TARGET%
|
||||
echo.
|
||||
nmap -Pn %TARGET%
|
||||
goto SCAN_DONE
|
||||
)
|
||||
if "%HOSTSCAN%"=="3" (
|
||||
echo Command: nmap -PS80 %TARGET%
|
||||
echo.
|
||||
nmap -PS80 %TARGET%
|
||||
goto SCAN_DONE
|
||||
)
|
||||
if "%HOSTSCAN%"=="4" (
|
||||
echo Command: nmap -PE %TARGET%
|
||||
echo.
|
||||
nmap -PE %TARGET%
|
||||
goto SCAN_DONE
|
||||
)
|
||||
echo Invalid option!
|
||||
goto MENU
|
||||
|
||||
:OS_DETECTION
|
||||
echo OS DETECTION OPTIONS
|
||||
echo ========================================
|
||||
echo [1] Basic OS detection
|
||||
echo [2] Aggressive OS detection with guessing
|
||||
echo [3] OS detection with version info
|
||||
echo.
|
||||
set /p OSSCAN="Select OS detection option: "
|
||||
echo.
|
||||
|
||||
if "%OSSCAN%"=="1" (
|
||||
echo Command: nmap -O %TARGET%
|
||||
echo.
|
||||
nmap -O %TARGET%
|
||||
goto SCAN_DONE
|
||||
)
|
||||
if "%OSSCAN%"=="2" (
|
||||
echo Command: nmap -O --osscan-guess %TARGET%
|
||||
echo.
|
||||
nmap -O --osscan-guess %TARGET%
|
||||
goto SCAN_DONE
|
||||
)
|
||||
if "%OSSCAN%"=="3" (
|
||||
echo Command: nmap -A %TARGET%
|
||||
echo.
|
||||
nmap -A %TARGET%
|
||||
goto SCAN_DONE
|
||||
)
|
||||
echo Invalid option!
|
||||
goto MENU
|
||||
|
||||
:STEALTH_SCAN
|
||||
echo STEALTH SCAN OPTIONS (SYN Scan)
|
||||
echo ========================================
|
||||
echo [1] Basic SYN scan (top 1000 ports)
|
||||
echo [2] SYN scan all ports
|
||||
echo [3] SYN scan with timing (fast T4)
|
||||
echo [4] SYN scan with timing (slow/stealth T2)
|
||||
echo.
|
||||
set /p SYNSCAN="Select SYN scan option: "
|
||||
echo.
|
||||
|
||||
if "%SYNSCAN%"=="1" (
|
||||
echo Command: nmap -sS %TARGET%
|
||||
echo.
|
||||
nmap -sS %TARGET%
|
||||
goto SCAN_DONE
|
||||
)
|
||||
if "%SYNSCAN%"=="2" (
|
||||
echo Command: nmap -sS -p- %TARGET%
|
||||
echo.
|
||||
nmap -sS -p- %TARGET%
|
||||
goto SCAN_DONE
|
||||
)
|
||||
if "%SYNSCAN%"=="3" (
|
||||
echo Command: nmap -sS -T4 %TARGET%
|
||||
echo.
|
||||
nmap -sS -T4 %TARGET%
|
||||
goto SCAN_DONE
|
||||
)
|
||||
if "%SYNSCAN%"=="4" (
|
||||
echo Command: nmap -sS -T2 %TARGET%
|
||||
echo.
|
||||
nmap -sS -T2 %TARGET%
|
||||
goto SCAN_DONE
|
||||
)
|
||||
echo Invalid option!
|
||||
goto MENU
|
||||
|
||||
:AGGRESSIVE_SCAN
|
||||
echo AGGRESSIVE SCAN OPTIONS
|
||||
echo ========================================
|
||||
echo [1] Full aggressive scan (OS, scripts, traceroute)
|
||||
echo [2] Aggressive with fast timing (T4)
|
||||
echo [3] Aggressive all ports
|
||||
echo.
|
||||
set /p AGGSCAN="Select aggressive scan option: "
|
||||
echo.
|
||||
|
||||
if "%AGGSCAN%"=="1" (
|
||||
echo Command: nmap -A %TARGET%
|
||||
echo.
|
||||
nmap -A %TARGET%
|
||||
goto SCAN_DONE
|
||||
)
|
||||
if "%AGGSCAN%"=="2" (
|
||||
echo Command: nmap -A -T4 %TARGET%
|
||||
echo.
|
||||
nmap -A -T4 %TARGET%
|
||||
goto SCAN_DONE
|
||||
)
|
||||
if "%AGGSCAN%"=="3" (
|
||||
echo Command: nmap -A -p- %TARGET%
|
||||
echo.
|
||||
nmap -A -p- %TARGET%
|
||||
goto SCAN_DONE
|
||||
)
|
||||
echo Invalid option!
|
||||
goto MENU
|
||||
|
||||
:UDP_SCAN
|
||||
echo UDP SCAN OPTIONS
|
||||
echo ========================================
|
||||
echo [1] UDP scan top 1000 ports
|
||||
echo [2] UDP scan specific port
|
||||
echo [3] UDP scan port range
|
||||
echo [4] Combined TCP SYN + UDP scan
|
||||
echo.
|
||||
set /p UDPSCAN="Select UDP scan option: "
|
||||
echo.
|
||||
|
||||
if "%UDPSCAN%"=="1" (
|
||||
echo Command: nmap -sU %TARGET%
|
||||
echo.
|
||||
nmap -sU %TARGET%
|
||||
goto SCAN_DONE
|
||||
)
|
||||
if "%UDPSCAN%"=="2" (
|
||||
set /p UDPPORT="Enter UDP port number: "
|
||||
echo Command: nmap -sU -p !UDPPORT! %TARGET%
|
||||
echo.
|
||||
nmap -sU -p !UDPPORT! %TARGET%
|
||||
goto SCAN_DONE
|
||||
)
|
||||
if "%UDPSCAN%"=="3" (
|
||||
set /p UDPRANGE="Enter UDP port range (e.g., 1-100): "
|
||||
echo Command: nmap -sU -p !UDPRANGE! %TARGET%
|
||||
echo.
|
||||
nmap -sU -p !UDPRANGE! %TARGET%
|
||||
goto SCAN_DONE
|
||||
)
|
||||
if "%UDPSCAN%"=="4" (
|
||||
echo Command: nmap -sS -sU -T4 %TARGET%
|
||||
echo.
|
||||
nmap -sS -sU -T4 %TARGET%
|
||||
goto SCAN_DONE
|
||||
)
|
||||
echo Invalid option!
|
||||
goto MENU
|
||||
|
||||
:SCRIPT_SCAN
|
||||
echo SCRIPT SCAN OPTIONS (NSE)
|
||||
echo ========================================
|
||||
echo [1] Default scripts
|
||||
echo [2] Vulnerability detection scripts
|
||||
echo [3] All safe scripts
|
||||
echo [4] Specific script category
|
||||
echo.
|
||||
set /p SCRIPTSCAN="Select script scan option: "
|
||||
echo.
|
||||
|
||||
if "%SCRIPTSCAN%"=="1" (
|
||||
echo Command: nmap -sC %TARGET%
|
||||
echo.
|
||||
nmap -sC %TARGET%
|
||||
goto SCAN_DONE
|
||||
)
|
||||
if "%SCRIPTSCAN%"=="2" (
|
||||
echo Command: nmap --script vuln %TARGET%
|
||||
echo.
|
||||
nmap --script vuln %TARGET%
|
||||
goto SCAN_DONE
|
||||
)
|
||||
if "%SCRIPTSCAN%"=="3" (
|
||||
echo Command: nmap --script safe %TARGET%
|
||||
echo.
|
||||
nmap --script safe %TARGET%
|
||||
goto SCAN_DONE
|
||||
)
|
||||
if "%SCRIPTSCAN%"=="4" (
|
||||
echo Available categories: auth, broadcast, brute, default, discovery, dos, exploit, external, fuzzer, intrusive, malware, safe, version, vuln
|
||||
set /p SCRIPTCAT="Enter script category: "
|
||||
echo Command: nmap --script !SCRIPTCAT! %TARGET%
|
||||
echo.
|
||||
nmap --script !SCRIPTCAT! %TARGET%
|
||||
goto SCAN_DONE
|
||||
)
|
||||
echo Invalid option!
|
||||
goto MENU
|
||||
|
||||
:SAVE_RESULTS
|
||||
echo SAVE RESULTS OPTIONS
|
||||
echo ========================================
|
||||
echo [1] Save as text file
|
||||
echo [2] Save as XML file
|
||||
echo [3] Save as grepable format
|
||||
echo [4] Save all formats
|
||||
echo.
|
||||
set /p SAVESCAN="Select save format: "
|
||||
echo.
|
||||
|
||||
set FILENAME=nmap_scan_%TARGET%_%date:~-4,4%%date:~-7,2%%date:~-10,2%_%time:~0,2%%time:~3,2%%time:~6,2%
|
||||
set FILENAME=%FILENAME: =0%
|
||||
|
||||
if "%SAVESCAN%"=="1" (
|
||||
echo Command: nmap -oN %FILENAME%.txt %TARGET%
|
||||
echo.
|
||||
nmap -oN %FILENAME%.txt %TARGET%
|
||||
echo Output saved to: %FILENAME%.txt
|
||||
goto SCAN_DONE
|
||||
)
|
||||
if "%SAVESCAN%"=="2" (
|
||||
echo Command: nmap -oX %FILENAME%.xml %TARGET%
|
||||
echo.
|
||||
nmap -oX %FILENAME%.xml %TARGET%
|
||||
echo Output saved to: %FILENAME%.xml
|
||||
goto SCAN_DONE
|
||||
)
|
||||
if "%SAVESCAN%"=="3" (
|
||||
echo Command: nmap -oG %FILENAME%.gnmap %TARGET%
|
||||
echo.
|
||||
nmap -oG %FILENAME%.gnmap %TARGET%
|
||||
echo Output saved to: %FILENAME%.gnmap
|
||||
goto SCAN_DONE
|
||||
)
|
||||
if "%SAVESCAN%"=="4" (
|
||||
echo Command: nmap -oA %FILENAME% %TARGET%
|
||||
echo.
|
||||
nmap -oA %FILENAME% %TARGET%
|
||||
echo Output saved to: %FILENAME%.* (all formats)
|
||||
goto SCAN_DONE
|
||||
)
|
||||
echo Invalid option!
|
||||
goto MENU
|
||||
|
||||
:CUSTOM_COMMAND
|
||||
set /p CUSTOM="Enter custom Nmap parameters (without 'nmap' and target): "
|
||||
echo.
|
||||
echo Command: nmap %CUSTOM% %TARGET%
|
||||
echo.
|
||||
nmap %CUSTOM% %TARGET%
|
||||
goto SCAN_DONE
|
||||
|
||||
:SCAN_DONE
|
||||
echo.
|
||||
echo ========================================
|
||||
echo Scan completed!
|
||||
echo ========================================
|
||||
echo.
|
||||
|
||||
set /p CONTINUE="Do you want to run another scan? (Y/N): "
|
||||
if /i "%CONTINUE%"=="Y" goto MENU
|
||||
|
||||
echo.
|
||||
echo Exiting...
|
||||
pause
|
||||
816
files/experimental/software-management-tool.bat
Normal file
816
files/experimental/software-management-tool.bat
Normal file
@@ -0,0 +1,816 @@
|
||||
@echo off
|
||||
REM === Software Management Tool ===
|
||||
chcp 65001 >nul
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
:MENU
|
||||
cls
|
||||
echo ========================================
|
||||
echo Software Management Tool
|
||||
echo ========================================
|
||||
echo.
|
||||
set /p ENABLE_EXPORT="Enable auto-export of reports? (Y/N): "
|
||||
echo.
|
||||
echo ========================================
|
||||
echo.
|
||||
echo [1] Scan installed software
|
||||
echo [2] Check for updates
|
||||
echo [3] Uninstall software
|
||||
echo [4] Full system report
|
||||
echo [0] Exit
|
||||
echo.
|
||||
echo ========================================
|
||||
set /p CHOICE="Select option: "
|
||||
|
||||
if "%CHOICE%"=="1" goto SCAN_SOFTWARE
|
||||
if "%CHOICE%"=="2" goto CHECK_UPDATES
|
||||
if "%CHOICE%"=="3" goto UNINSTALL_SOFTWARE
|
||||
if "%CHOICE%"=="4" goto FULL_REPORT
|
||||
if "%CHOICE%"=="0" goto EXIT
|
||||
goto MENU
|
||||
|
||||
:SCAN_SOFTWARE
|
||||
cls
|
||||
echo ========================================
|
||||
echo Scan Installed Software
|
||||
echo ========================================
|
||||
echo.
|
||||
echo Scanning system registry...
|
||||
echo.
|
||||
|
||||
set "tempfile=%TEMP%\software_scan_%RANDOM%.tmp"
|
||||
|
||||
(
|
||||
echo ========================================
|
||||
echo INSTALLED SOFTWARE SCAN
|
||||
echo Date: %date% %time%
|
||||
echo Computer: %COMPUTERNAME%
|
||||
echo ========================================
|
||||
echo.
|
||||
) > "%tempfile%"
|
||||
|
||||
REM 64-Bit Software
|
||||
echo [1/3] Scanning 64-bit programs...
|
||||
(
|
||||
echo [64-BIT PROGRAMS]
|
||||
echo ----------------------------------------
|
||||
) >> "%tempfile%"
|
||||
|
||||
set COUNT64=0
|
||||
for /f "tokens=*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" 2^>nul') do (
|
||||
set "hasname="
|
||||
set "hasver="
|
||||
for /f "skip=2 tokens=2*" %%b in ('reg query "%%a" /v DisplayName 2^>nul') do set "hasname=%%c"
|
||||
for /f "skip=2 tokens=2*" %%b in ('reg query "%%a" /v DisplayVersion 2^>nul') do set "hasver=%%c"
|
||||
|
||||
if defined hasname (
|
||||
set /a COUNT64+=1
|
||||
if defined hasver (
|
||||
echo !hasname! [!hasver!] >> "%tempfile%"
|
||||
) else (
|
||||
echo !hasname! >> "%tempfile%"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
echo Total: !COUNT64! programs >> "%tempfile%"
|
||||
echo. >> "%tempfile%"
|
||||
|
||||
REM 32-Bit Software
|
||||
echo [2/3] Scanning 32-bit programs...
|
||||
(
|
||||
echo [32-BIT PROGRAMS]
|
||||
echo ----------------------------------------
|
||||
) >> "%tempfile%"
|
||||
|
||||
set COUNT32=0
|
||||
for /f "tokens=*" %%a in ('reg query "HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall" 2^>nul') do (
|
||||
set "hasname="
|
||||
set "hasver="
|
||||
for /f "skip=2 tokens=2*" %%b in ('reg query "%%a" /v DisplayName 2^>nul') do set "hasname=%%c"
|
||||
for /f "skip=2 tokens=2*" %%b in ('reg query "%%a" /v DisplayVersion 2^>nul') do set "hasver=%%c"
|
||||
|
||||
if defined hasname (
|
||||
set /a COUNT32+=1
|
||||
if defined hasver (
|
||||
echo !hasname! [!hasver!] >> "%tempfile%"
|
||||
) else (
|
||||
echo !hasname! >> "%tempfile%"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
echo Total: !COUNT32! programs >> "%tempfile%"
|
||||
echo. >> "%tempfile%"
|
||||
|
||||
REM User Software
|
||||
echo [3/3] Scanning user-installed programs...
|
||||
(
|
||||
echo [USER PROGRAMS]
|
||||
echo ----------------------------------------
|
||||
) >> "%tempfile%"
|
||||
|
||||
set COUNTUSER=0
|
||||
for /f "tokens=*" %%a in ('reg query "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" 2^>nul') do (
|
||||
set "hasname="
|
||||
set "hasver="
|
||||
for /f "skip=2 tokens=2*" %%b in ('reg query "%%a" /v DisplayName 2^>nul') do set "hasname=%%c"
|
||||
for /f "skip=2 tokens=2*" %%b in ('reg query "%%a" /v DisplayVersion 2^>nul') do set "hasver=%%c"
|
||||
|
||||
if defined hasname (
|
||||
set /a COUNTUSER+=1
|
||||
if defined hasver (
|
||||
echo !hasname! [!hasver!] >> "%tempfile%"
|
||||
) else (
|
||||
echo !hasname! >> "%tempfile%"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
echo Total: !COUNTUSER! programs >> "%tempfile%"
|
||||
echo. >> "%tempfile%"
|
||||
|
||||
set /a TOTAL=COUNT64+COUNT32+COUNTUSER
|
||||
(
|
||||
echo ========================================
|
||||
echo SUMMARY
|
||||
echo ========================================
|
||||
echo 64-bit programs: !COUNT64!
|
||||
echo 32-bit programs: !COUNT32!
|
||||
echo User programs: !COUNTUSER!
|
||||
echo ----------------------------------------
|
||||
echo Total installed: !TOTAL!
|
||||
echo ========================================
|
||||
) >> "%tempfile%"
|
||||
|
||||
cls
|
||||
type "%tempfile%"
|
||||
echo.
|
||||
|
||||
if /i "%ENABLE_EXPORT%"=="Y" call :EXPORT_FILE "%tempfile%" "Software_Scan"
|
||||
|
||||
del "%tempfile%" >nul 2>&1
|
||||
pause
|
||||
goto MENU
|
||||
|
||||
:CHECK_UPDATES
|
||||
cls
|
||||
echo ========================================
|
||||
echo Check for Updates
|
||||
echo ========================================
|
||||
echo.
|
||||
|
||||
set "tempfile=%TEMP%\update_check_%RANDOM%.tmp"
|
||||
set "updatelist=%TEMP%\update_programs_%RANDOM%.tmp"
|
||||
|
||||
(
|
||||
echo ========================================
|
||||
echo UPDATE CHECK REPORT
|
||||
echo Date: %date% %time%
|
||||
echo Computer: %COMPUTERNAME%
|
||||
echo ========================================
|
||||
echo.
|
||||
) > "%tempfile%"
|
||||
|
||||
echo Checking for available updates...
|
||||
echo.
|
||||
|
||||
REM Check if winget is available
|
||||
where winget >nul 2>&1
|
||||
if %errorlevel%==0 (
|
||||
echo Using Windows Package Manager (winget)...
|
||||
echo. >> "%tempfile%"
|
||||
echo [AVAILABLE UPDATES] >> "%tempfile%"
|
||||
echo ---------------------------------------- >> "%tempfile%"
|
||||
|
||||
REM Get list of upgradeable packages
|
||||
winget upgrade > "%updatelist%" 2>&1
|
||||
type "%updatelist%" >> "%tempfile%"
|
||||
|
||||
echo. >> "%tempfile%"
|
||||
echo ======================================== >> "%tempfile%"
|
||||
) else (
|
||||
echo [NOTE] Winget is not installed. >> "%tempfile%"
|
||||
echo Cannot check for updates automatically. >> "%tempfile%"
|
||||
echo. >> "%tempfile%"
|
||||
echo Please install Windows Package Manager or check manually. >> "%tempfile%"
|
||||
echo ======================================== >> "%tempfile%"
|
||||
|
||||
cls
|
||||
type "%tempfile%"
|
||||
echo.
|
||||
|
||||
if /i "%ENABLE_EXPORT%"=="Y" call :EXPORT_FILE "%tempfile%" "Update_Check"
|
||||
|
||||
del "%tempfile%" >nul 2>&1
|
||||
del "%updatelist%" >nul 2>&1
|
||||
pause
|
||||
goto MENU
|
||||
)
|
||||
|
||||
cls
|
||||
type "%tempfile%"
|
||||
echo.
|
||||
|
||||
REM Check if updates are available
|
||||
findstr /C:"upgrades available" "%updatelist%" >nul 2>&1
|
||||
if %errorlevel%==0 (
|
||||
echo No updates available.
|
||||
if /i "%ENABLE_EXPORT%"=="Y" call :EXPORT_FILE "%tempfile%" "Update_Check"
|
||||
del "%tempfile%" >nul 2>&1
|
||||
del "%updatelist%" >nul 2>&1
|
||||
pause
|
||||
goto MENU
|
||||
)
|
||||
|
||||
echo ========================================
|
||||
set /p INSTALL_CHOICE="Install updates? (Y/N): "
|
||||
|
||||
if /i not "%INSTALL_CHOICE%"=="Y" (
|
||||
if /i "%ENABLE_EXPORT%"=="Y" call :EXPORT_FILE "%tempfile%" "Update_Check"
|
||||
del "%tempfile%" >nul 2>&1
|
||||
del "%updatelist%" >nul 2>&1
|
||||
pause
|
||||
goto MENU
|
||||
)
|
||||
|
||||
cls
|
||||
echo ========================================
|
||||
echo Install Updates
|
||||
echo ========================================
|
||||
echo.
|
||||
echo [1] Update all programs
|
||||
echo [2] Select specific programs
|
||||
echo [0] Cancel
|
||||
echo.
|
||||
set /p UPDATE_METHOD="Select option: "
|
||||
|
||||
if "%UPDATE_METHOD%"=="1" (
|
||||
del "%tempfile%" >nul 2>&1
|
||||
del "%updatelist%" >nul 2>&1
|
||||
goto UPDATE_ALL_PROGRAMS
|
||||
)
|
||||
if "%UPDATE_METHOD%"=="2" (
|
||||
goto SELECT_UPDATES
|
||||
)
|
||||
if "%UPDATE_METHOD%"=="0" (
|
||||
if /i "%ENABLE_EXPORT%"=="Y" call :EXPORT_FILE "%tempfile%" "Update_Check"
|
||||
del "%tempfile%" >nul 2>&1
|
||||
del "%updatelist%" >nul 2>&1
|
||||
pause
|
||||
goto MENU
|
||||
)
|
||||
|
||||
del "%tempfile%" >nul 2>&1
|
||||
del "%updatelist%" >nul 2>&1
|
||||
goto CHECK_UPDATES
|
||||
|
||||
:SELECT_UPDATES
|
||||
cls
|
||||
echo ========================================
|
||||
echo Select Programs to Update
|
||||
echo ========================================
|
||||
echo.
|
||||
echo Extracting available updates...
|
||||
echo.
|
||||
|
||||
set "pkglist=%TEMP%\packages_%RANDOM%.tmp"
|
||||
|
||||
REM Extract package IDs from winget output
|
||||
winget upgrade | findstr /V /C:"Name" /C:"---" /C:"upgrades available" | findstr /V "^$" > "%pkglist%" 2>nul
|
||||
|
||||
REM Count available packages
|
||||
set PKG_COUNT=0
|
||||
for /f "tokens=*" %%a in ('type "%pkglist%"') do set /a PKG_COUNT+=1
|
||||
|
||||
if %PKG_COUNT%==0 (
|
||||
echo No updatable packages found.
|
||||
del "%pkglist%" >nul 2>&1
|
||||
del "%tempfile%" >nul 2>&1
|
||||
del "%updatelist%" >nul 2>&1
|
||||
pause
|
||||
goto MENU
|
||||
)
|
||||
|
||||
REM Display packages with numbers
|
||||
cls
|
||||
echo ========================================
|
||||
echo Available Updates
|
||||
echo ========================================
|
||||
echo.
|
||||
echo Enter the numbers of programs to update (separated by spaces)
|
||||
echo Example: 1 3 5 7
|
||||
echo.
|
||||
echo ----------------------------------------
|
||||
|
||||
set INDEX=0
|
||||
for /f "tokens=1* delims= " %%a in ('type "%pkglist%"') do (
|
||||
set /a INDEX+=1
|
||||
set "PKG_!INDEX!=%%a"
|
||||
echo [!INDEX!] %%a
|
||||
)
|
||||
|
||||
echo ----------------------------------------
|
||||
echo.
|
||||
set /p SELECTIONS="Enter numbers (space-separated): "
|
||||
|
||||
if "%SELECTIONS%"=="" (
|
||||
echo [ERROR] No selection made!
|
||||
del "%pkglist%" >nul 2>&1
|
||||
del "%tempfile%" >nul 2>&1
|
||||
del "%updatelist%" >nul 2>&1
|
||||
pause
|
||||
goto MENU
|
||||
)
|
||||
|
||||
cls
|
||||
echo ========================================
|
||||
echo Installing Selected Updates
|
||||
echo ========================================
|
||||
echo.
|
||||
|
||||
set "logfile=%TEMP%\update_selected_%RANDOM%.log"
|
||||
|
||||
(
|
||||
echo ========================================
|
||||
echo SELECTED UPDATES INSTALLATION LOG
|
||||
echo Date: %date% %time%
|
||||
echo ========================================
|
||||
echo.
|
||||
) > "%logfile%"
|
||||
|
||||
REM Process selections
|
||||
for %%S in (%SELECTIONS%) do (
|
||||
if defined PKG_%%S (
|
||||
echo ---------------------------------------- >> "%logfile%"
|
||||
echo Updating: !PKG_%%S! >> "%logfile%"
|
||||
echo ---------------------------------------- >> "%logfile%"
|
||||
echo Updating: !PKG_%%S!
|
||||
|
||||
winget upgrade --id "!PKG_%%S!" --accept-source-agreements --accept-package-agreements >> "%logfile%" 2>&1
|
||||
|
||||
echo. >> "%logfile%"
|
||||
)
|
||||
)
|
||||
|
||||
echo ======================================== >> "%logfile%"
|
||||
echo Update process completed. >> "%logfile%"
|
||||
|
||||
cls
|
||||
type "%logfile%"
|
||||
echo.
|
||||
|
||||
if /i "%ENABLE_EXPORT%"=="Y" call :EXPORT_FILE "%logfile%" "Update_Selected"
|
||||
|
||||
del "%logfile%" >nul 2>&1
|
||||
del "%pkglist%" >nul 2>&1
|
||||
del "%tempfile%" >nul 2>&1
|
||||
del "%updatelist%" >nul 2>&1
|
||||
pause
|
||||
goto MENU
|
||||
|
||||
:UPDATE_ALL_PROGRAMS
|
||||
cls
|
||||
echo ========================================
|
||||
echo Update All Programs
|
||||
echo ========================================
|
||||
echo.
|
||||
echo Updating all available programs...
|
||||
echo.
|
||||
|
||||
set "logfile=%TEMP%\update_all_%RANDOM%.log"
|
||||
|
||||
(
|
||||
echo ========================================
|
||||
echo UPDATE ALL PROGRAMS LOG
|
||||
echo Date: %date% %time%
|
||||
echo ========================================
|
||||
echo.
|
||||
) > "%logfile%"
|
||||
|
||||
where winget >nul 2>&1
|
||||
if %errorlevel%==0 (
|
||||
echo Starting update process... >> "%logfile%"
|
||||
echo. >> "%logfile%"
|
||||
|
||||
winget upgrade --all --accept-source-agreements --accept-package-agreements >> "%logfile%" 2>&1
|
||||
|
||||
echo. >> "%logfile%"
|
||||
echo Update process completed. >> "%logfile%"
|
||||
) else (
|
||||
echo [ERROR] Winget is not installed! >> "%logfile%"
|
||||
echo Cannot update programs automatically. >> "%logfile%"
|
||||
)
|
||||
|
||||
echo ======================================== >> "%logfile%"
|
||||
|
||||
cls
|
||||
type "%logfile%"
|
||||
echo.
|
||||
|
||||
if /i "%ENABLE_EXPORT%"=="Y" call :EXPORT_FILE "%logfile%" "Update_All"
|
||||
|
||||
del "%logfile%" >nul 2>&1
|
||||
pause
|
||||
goto MENU
|
||||
|
||||
:UNINSTALL_SOFTWARE
|
||||
cls
|
||||
echo ========================================
|
||||
echo Uninstall Software
|
||||
echo ========================================
|
||||
echo.
|
||||
echo [1] View installed programs
|
||||
echo [2] Uninstall by name
|
||||
echo [3] Select programs to uninstall (interactive)
|
||||
echo [0] Back to menu
|
||||
echo.
|
||||
set /p UNINSTALL_CHOICE="Select option: "
|
||||
|
||||
if "%UNINSTALL_CHOICE%"=="1" goto VIEW_FOR_UNINSTALL
|
||||
if "%UNINSTALL_CHOICE%"=="2" goto UNINSTALL_BY_NAME
|
||||
if "%UNINSTALL_CHOICE%"=="3" goto SELECT_UNINSTALL
|
||||
if "%UNINSTALL_CHOICE%"=="0" goto MENU
|
||||
goto UNINSTALL_SOFTWARE
|
||||
|
||||
:VIEW_FOR_UNINSTALL
|
||||
cls
|
||||
echo ========================================
|
||||
echo Installed Programs
|
||||
echo ========================================
|
||||
echo.
|
||||
echo Scanning...
|
||||
echo.
|
||||
|
||||
set "tempfile=%TEMP%\uninstall_list_%RANDOM%.tmp"
|
||||
|
||||
(
|
||||
echo Available Programs:
|
||||
echo ========================================
|
||||
echo.
|
||||
) > "%tempfile%"
|
||||
|
||||
set COUNT=0
|
||||
for /f "tokens=*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" 2^>nul') do (
|
||||
for /f "skip=2 tokens=2*" %%b in ('reg query "%%a" /v DisplayName 2^>nul') do (
|
||||
set /a COUNT+=1
|
||||
echo !COUNT!. %%c >> "%tempfile%"
|
||||
)
|
||||
)
|
||||
|
||||
for /f "tokens=*" %%a in ('reg query "HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall" 2^>nul') do (
|
||||
for /f "skip=2 tokens=2*" %%b in ('reg query "%%a" /v DisplayName 2^>nul') do (
|
||||
set /a COUNT+=1
|
||||
echo !COUNT!. %%c >> "%tempfile%"
|
||||
)
|
||||
)
|
||||
|
||||
cls
|
||||
type "%tempfile%"
|
||||
echo.
|
||||
echo ========================================
|
||||
|
||||
del "%tempfile%" >nul 2>&1
|
||||
pause
|
||||
goto UNINSTALL_SOFTWARE
|
||||
|
||||
:SELECT_UNINSTALL
|
||||
cls
|
||||
echo ========================================
|
||||
echo Select Programs to Uninstall
|
||||
echo ========================================
|
||||
echo.
|
||||
echo Scanning installed programs...
|
||||
echo.
|
||||
|
||||
REM Collect all programs directly into arrays
|
||||
set INDEX=0
|
||||
set "templist=%TEMP%\prog_temp_%RANDOM%.txt"
|
||||
|
||||
echo Collecting 64-bit programs...
|
||||
reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" 2>nul > "%templist%"
|
||||
for /f "tokens=*" %%a in ('type "%templist%"') do (
|
||||
reg query "%%a" /v DisplayName 2>nul | findstr "DisplayName" >nul
|
||||
if !errorlevel!==0 (
|
||||
for /f "skip=2 tokens=2*" %%b in ('reg query "%%a" /v DisplayName 2^>nul') do (
|
||||
set /a INDEX+=1
|
||||
set "PROG_NAME_!INDEX!=%%c"
|
||||
set "PROG_REG_!INDEX!=%%a"
|
||||
set "SELECTED_!INDEX!=0"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
echo Collecting 32-bit programs...
|
||||
reg query "HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall" 2>nul > "%templist%"
|
||||
for /f "tokens=*" %%a in ('type "%templist%"') do (
|
||||
reg query "%%a" /v DisplayName 2>nul | findstr "DisplayName" >nul
|
||||
if !errorlevel!==0 (
|
||||
for /f "skip=2 tokens=2*" %%b in ('reg query "%%a" /v DisplayName 2^>nul') do (
|
||||
set /a INDEX+=1
|
||||
set "PROG_NAME_!INDEX!=%%c"
|
||||
set "PROG_REG_!INDEX!=%%a"
|
||||
set "SELECTED_!INDEX!=0"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
echo Collecting user programs...
|
||||
reg query "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" 2>nul > "%templist%"
|
||||
for /f "tokens=*" %%a in ('type "%templist%"') do (
|
||||
reg query "%%a" /v DisplayName 2>nul | findstr "DisplayName" >nul
|
||||
if !errorlevel!==0 (
|
||||
for /f "skip=2 tokens=2*" %%b in ('reg query "%%a" /v DisplayName 2^>nul') do (
|
||||
set /a INDEX+=1
|
||||
set "PROG_NAME_!INDEX!=%%c (User)"
|
||||
set "PROG_REG_!INDEX!=%%a"
|
||||
set "SELECTED_!INDEX!=0"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
del "%templist%" >nul 2>&1
|
||||
echo.
|
||||
echo Found !INDEX! programs total.
|
||||
|
||||
if %INDEX%==0 (
|
||||
echo No programs found!
|
||||
pause
|
||||
goto UNINSTALL_SOFTWARE
|
||||
)
|
||||
|
||||
set CURRENT=1
|
||||
set TOTAL=%INDEX%
|
||||
|
||||
:DISPLAY_SELECTION
|
||||
cls
|
||||
echo ========================================
|
||||
echo Select Programs to Uninstall
|
||||
echo ========================================
|
||||
echo.
|
||||
echo Enter the numbers of programs to uninstall (separated by spaces)
|
||||
echo Example: 1 3 5 7
|
||||
echo Or press 0 to cancel
|
||||
echo.
|
||||
echo ----------------------------------------
|
||||
echo.
|
||||
|
||||
REM Display all programs with numbers
|
||||
for /l %%i in (1,1,%TOTAL%) do (
|
||||
echo [%%i] !PROG_NAME_%%i!
|
||||
)
|
||||
|
||||
echo.
|
||||
echo ----------------------------------------
|
||||
set /p SELECTIONS="Enter numbers (space-separated) or 0 to cancel: "
|
||||
|
||||
if "%SELECTIONS%"=="0" goto CANCEL_SELECTION
|
||||
if "%SELECTIONS%"=="" goto DISPLAY_SELECTION
|
||||
|
||||
REM Mark selected programs
|
||||
for %%S in (%SELECTIONS%) do (
|
||||
if defined PROG_NAME_%%S (
|
||||
set "SELECTED_%%S=1"
|
||||
)
|
||||
)
|
||||
|
||||
goto CONFIRM_SELECTION
|
||||
|
||||
:CANCEL_SELECTION
|
||||
goto UNINSTALL_SOFTWARE
|
||||
|
||||
:CONFIRM_SELECTION
|
||||
REM Check if any programs selected
|
||||
set SELECTED_COUNT=0
|
||||
for /l %%i in (1,1,%TOTAL%) do (
|
||||
if !SELECTED_%%i!==1 set /a SELECTED_COUNT+=1
|
||||
)
|
||||
|
||||
if %SELECTED_COUNT%==0 (
|
||||
echo.
|
||||
echo [WARNING] No valid programs selected!
|
||||
timeout /t 2 >nul
|
||||
goto CANCEL_SELECTION
|
||||
)
|
||||
|
||||
cls
|
||||
echo ========================================
|
||||
echo Confirm Uninstallation
|
||||
echo ========================================
|
||||
echo.
|
||||
echo The following programs will be uninstalled:
|
||||
echo.
|
||||
|
||||
for /l %%i in (1,1,%TOTAL%) do (
|
||||
if !SELECTED_%%i!==1 (
|
||||
echo - !PROG_NAME_%%i!
|
||||
)
|
||||
)
|
||||
|
||||
echo.
|
||||
echo ========================================
|
||||
set /p CONFIRM="Are you sure? (Y/N): "
|
||||
|
||||
if /i not "%CONFIRM%"=="Y" goto CANCEL_SELECTION
|
||||
|
||||
cls
|
||||
echo ========================================
|
||||
echo Uninstalling Selected Programs
|
||||
echo ========================================
|
||||
echo.
|
||||
|
||||
set "logfile=%TEMP%\\uninstall_log_%RANDOM%.log"
|
||||
|
||||
(
|
||||
echo ========================================
|
||||
echo UNINSTALL LOG
|
||||
echo Date: %date% %time%
|
||||
echo ========================================
|
||||
echo.
|
||||
) > "%logfile%"
|
||||
|
||||
REM Uninstall selected programs
|
||||
for /l %%i in (1,1,%TOTAL%) do (
|
||||
if !SELECTED_%%i!==1 (
|
||||
echo ---------------------------------------- >> "%logfile%"
|
||||
echo Uninstalling: !PROG_NAME_%%i! >> "%logfile%"
|
||||
echo Registry: !PROG_REG_%%i! >> "%logfile%"
|
||||
echo ---------------------------------------- >> "%logfile%"
|
||||
echo Uninstalling: !PROG_NAME_%%i!
|
||||
|
||||
REM Try to get uninstall string
|
||||
for /f "skip=2 tokens=2*" %%u in ('reg query "!PROG_REG_%%i!" /v UninstallString 2^>nul') do (
|
||||
echo Uninstall command: %%v >> "%logfile%"
|
||||
|
||||
REM Execute uninstall
|
||||
echo Running uninstaller... >> "%logfile%"
|
||||
start /wait "" %%v >> "%logfile%" 2>&1
|
||||
|
||||
if !errorlevel!==0 (
|
||||
echo [SUCCESS] Uninstalled successfully >> "%logfile%"
|
||||
echo [SUCCESS] Uninstalled successfully
|
||||
) else (
|
||||
echo [WARNING] Uninstall may have failed or was cancelled >> "%logfile%"
|
||||
echo [WARNING] Uninstall may have failed or was cancelled
|
||||
)
|
||||
)
|
||||
|
||||
echo. >> "%logfile%"
|
||||
)
|
||||
)
|
||||
|
||||
echo ======================================== >> "%logfile%"
|
||||
echo Uninstall process completed. >> "%logfile%"
|
||||
|
||||
cls
|
||||
type "%logfile%"
|
||||
echo.
|
||||
|
||||
if /i "%ENABLE_EXPORT%"=="Y" call :EXPORT_FILE "%logfile%" "Uninstall_Selected"
|
||||
|
||||
del "%logfile%" >nul 2>&1
|
||||
pause
|
||||
goto MENU
|
||||
|
||||
:UNINSTALL_BY_NAME
|
||||
cls
|
||||
echo ========================================
|
||||
echo Uninstall by Name
|
||||
echo ========================================
|
||||
echo.
|
||||
set /p PROGRAM_NAME="Enter program name: "
|
||||
|
||||
if "%PROGRAM_NAME%"=="" (
|
||||
echo [ERROR] No program name entered!
|
||||
pause
|
||||
goto UNINSTALL_SOFTWARE
|
||||
)
|
||||
|
||||
echo.
|
||||
echo Searching for: %PROGRAM_NAME%
|
||||
echo.
|
||||
|
||||
where winget >nul 2>&1
|
||||
if %errorlevel%==0 (
|
||||
winget uninstall "%PROGRAM_NAME%"
|
||||
) else (
|
||||
echo [NOTE] Using Windows Settings...
|
||||
start ms-settings:appsfeatures
|
||||
)
|
||||
|
||||
pause
|
||||
goto MENU
|
||||
|
||||
:FULL_REPORT
|
||||
cls
|
||||
echo ========================================
|
||||
echo Full System Report
|
||||
echo ========================================
|
||||
echo.
|
||||
|
||||
set "tempfile=%TEMP%\full_report_%RANDOM%.tmp"
|
||||
|
||||
(
|
||||
echo ========================================
|
||||
echo FULL SYSTEM REPORT
|
||||
echo Date: %date% %time%
|
||||
echo Computer: %COMPUTERNAME%
|
||||
echo User: %USERNAME%
|
||||
echo ========================================
|
||||
echo.
|
||||
) > "%tempfile%"
|
||||
|
||||
echo [1/4] System Information...
|
||||
(
|
||||
echo [SYSTEM INFORMATION]
|
||||
echo ----------------------------------------
|
||||
) >> "%tempfile%"
|
||||
systeminfo | findstr /C:"OS Name" /C:"OS Version" /C:"System Type" /C:"Total Physical Memory" >> "%tempfile%"
|
||||
echo. >> "%tempfile%"
|
||||
|
||||
echo [2/4] Installed Software...
|
||||
(
|
||||
echo [INSTALLED SOFTWARE]
|
||||
echo ----------------------------------------
|
||||
) >> "%tempfile%"
|
||||
|
||||
set TOTALSOFT=0
|
||||
for /f "tokens=*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" 2^>nul') do (
|
||||
for /f "skip=2 tokens=2*" %%b in ('reg query "%%a" /v DisplayName 2^>nul') do (
|
||||
set /a TOTALSOFT+=1
|
||||
echo %%c >> "%tempfile%"
|
||||
)
|
||||
)
|
||||
|
||||
for /f "tokens=*" %%a in ('reg query "HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall" 2^>nul') do (
|
||||
for /f "skip=2 tokens=2*" %%b in ('reg query "%%a" /v DisplayName 2^>nul') do (
|
||||
set /a TOTALSOFT+=1
|
||||
echo %%c >> "%tempfile%"
|
||||
)
|
||||
)
|
||||
|
||||
echo. >> "%tempfile%"
|
||||
echo Total: !TOTALSOFT! programs >> "%tempfile%"
|
||||
echo. >> "%tempfile%"
|
||||
|
||||
echo [3/4] Running Processes...
|
||||
(
|
||||
echo [RUNNING PROCESSES]
|
||||
echo ----------------------------------------
|
||||
) >> "%tempfile%"
|
||||
tasklist >> "%tempfile%"
|
||||
echo. >> "%tempfile%"
|
||||
|
||||
echo [4/4] Available Updates...
|
||||
(
|
||||
echo [AVAILABLE UPDATES]
|
||||
echo ----------------------------------------
|
||||
) >> "%tempfile%"
|
||||
|
||||
where winget >nul 2>&1
|
||||
if %errorlevel%==0 (
|
||||
winget upgrade >> "%tempfile%" 2>&1
|
||||
) else (
|
||||
echo [NOTE] Winget is not installed. >> "%tempfile%"
|
||||
echo Cannot check for updates. >> "%tempfile%"
|
||||
)
|
||||
|
||||
echo ======================================== >> "%tempfile%"
|
||||
|
||||
cls
|
||||
type "%tempfile%"
|
||||
echo.
|
||||
|
||||
if /i "%ENABLE_EXPORT%"=="Y" call :EXPORT_FILE "%tempfile%" "Full_System_Report"
|
||||
|
||||
del "%tempfile%" >nul 2>&1
|
||||
pause
|
||||
goto MENU
|
||||
|
||||
:EXPORT_FILE
|
||||
set "source=%~1"
|
||||
set "basename=%~2"
|
||||
set "exportfile=%USERPROFILE%\Desktop\%basename%_%date:~-4,4%%date:~-7,2%%date:~-10,2%_%time:~0,2%%time:~3,2%%time:~6,2%.txt"
|
||||
set "exportfile=%exportfile: =0%"
|
||||
|
||||
copy "%source%" "%exportfile%" >nul 2>&1
|
||||
if %errorlevel%==0 (
|
||||
echo.
|
||||
echo [SUCCESS] Report exported to:
|
||||
echo %exportfile%
|
||||
echo.
|
||||
) else (
|
||||
echo.
|
||||
echo [ERROR] Could not export file!
|
||||
echo.
|
||||
)
|
||||
exit /b
|
||||
|
||||
:EXIT
|
||||
cls
|
||||
echo ========================================
|
||||
echo Thank you for using Software Management Tool
|
||||
echo ========================================
|
||||
echo.
|
||||
timeout /t 2 >nul
|
||||
exit
|
||||
@@ -1,6 +1,6 @@
|
||||
@echo off
|
||||
REM === Batchr Menu Launcher ===
|
||||
REM Repository: https://git.weektab.org/companas/batchr
|
||||
REM === HyperCLI Menu Launcher ===
|
||||
REM Repository: https://git.weektab.org/nexus/HyperCLI
|
||||
REM Powered by Weektab
|
||||
REM Author: Flamur Veliqi (Netbie)
|
||||
|
||||
@@ -8,14 +8,13 @@ setlocal enabledelayedexpansion
|
||||
|
||||
:MAIN_MENU
|
||||
cls
|
||||
echo Batchr Menu Launcher
|
||||
echo HyperCLI Menu Launcher
|
||||
echo.
|
||||
echo Powered by Weektab
|
||||
echo Web: www.weektab.org
|
||||
echo E-Mail: support@weektab.org
|
||||
echo Project: Companas
|
||||
echo Repository: git.weektab.org/companas/batchr
|
||||
echo Author: Flamur Veliqi (Netbie)
|
||||
echo Project: HyperCLI
|
||||
echo Repository: git.weektab.org/nexus/HyperCLI
|
||||
echo.
|
||||
echo //////////////////////////////////////////////////
|
||||
echo.
|
||||
@@ -49,13 +48,13 @@ goto MAIN_MENU
|
||||
|
||||
:MENU
|
||||
cls
|
||||
echo Batchr Menu Launcher - !CATEGORY_NAME!
|
||||
echo HyperCLI Menu Launcher - !CATEGORY_NAME!
|
||||
echo.
|
||||
echo Powered by Weektab
|
||||
echo Web: www.weektab.org
|
||||
echo E-Mail: support@weektab.org
|
||||
echo Project: Companas
|
||||
echo Repository: git.weektab.org/companas/batchr
|
||||
echo Project: HyperCLI
|
||||
echo Repository: git.weektab.org/nexus/HyperCLI
|
||||
echo Author: Flamur Veliqi (Netbie)
|
||||
echo.
|
||||
echo //////////////////////////////////////////////////
|
||||
@@ -64,7 +63,7 @@ echo Scanning /!SCRIPT_PATH! directory...
|
||||
echo.
|
||||
|
||||
REM Use Gitea API to list files in selected directory
|
||||
powershell -Command "$ProgressPreference = 'SilentlyContinue'; try { $response = Invoke-RestMethod -Uri 'https://git.weektab.org/api/v1/repos/companas/batchr/contents/!API_PATH!'; $batFiles = $response | Where-Object { $_.name -like '*.bat' } | Select-Object -ExpandProperty name | Sort-Object; if ($batFiles) { $batFiles | Out-File '%TEMP%\repo_scripts.txt' -Encoding ASCII -NoNewline:$false } else { 'NONE' | Out-File '%TEMP%\repo_scripts.txt' -Encoding ASCII } } catch { 'ERROR' | Out-File '%TEMP%\repo_scripts.txt' -Encoding ASCII }" 2>nul
|
||||
powershell -Command "$ProgressPreference = 'SilentlyContinue'; try { $response = Invoke-RestMethod -Uri 'https://git.weektab.org/api/v1/repos/nexus/HyperCLI/contents/!API_PATH!'; $batFiles = $response | Where-Object { $_.name -like '*.bat' } | Select-Object -ExpandProperty name | Sort-Object; if ($batFiles) { $batFiles | Out-File '%TEMP%\repo_scripts.txt' -Encoding ASCII -NoNewline:$false } else { 'NONE' | Out-File '%TEMP%\repo_scripts.txt' -Encoding ASCII } } catch { 'ERROR' | Out-File '%TEMP%\repo_scripts.txt' -Encoding ASCII }" 2>nul
|
||||
|
||||
if not exist "%TEMP%\repo_scripts.txt" (
|
||||
echo ERROR: Unable to access repository API
|
||||
@@ -95,7 +94,7 @@ if "%FIRST_LINE%"=="NONE" (
|
||||
REM Get all script titles in one PowerShell call
|
||||
echo Extracting list...
|
||||
echo.
|
||||
powershell -Command "$ProgressPreference = 'SilentlyContinue'; try { $files = Get-Content '%TEMP%\repo_scripts.txt'; $results = @(); foreach ($file in $files) { if ($file -and $file -ne '' -and $file -ne 'NONE' -and $file -ne 'ERROR') { try { $url = 'https://git.weektab.org/companas/batchr/raw/branch/main/!SCRIPT_PATH!/' + $file; $content = (Invoke-WebRequest -Uri $url -UseBasicParsing).Content; if ($content -match 'REM\s*===\s*(.+?)\s*===') { $results += $file + '|' + $matches[1] } else { $results += $file + '|' } } catch { $results += $file + '|' } } }; $results | Out-File '%TEMP%\repo_titles.txt' -Encoding ASCII } catch { }" 2>nul
|
||||
powershell -Command "$ProgressPreference = 'SilentlyContinue'; try { $files = Get-Content '%TEMP%\repo_scripts.txt'; $results = @(); foreach ($file in $files) { if ($file -and $file -ne '' -and $file -ne 'NONE' -and $file -ne 'ERROR') { try { $url = 'https://git.weektab.org/nexus/HyperCLI/raw/branch/main/!SCRIPT_PATH!/' + $file; $content = (Invoke-WebRequest -Uri $url -UseBasicParsing).Content; if ($content -match 'REM\s*===\s*(.+?)\s*===') { $results += $file + '|' + $matches[1] } else { $results += $file + '|' } } catch { $results += $file + '|' } } }; $results | Out-File '%TEMP%\repo_titles.txt' -Encoding ASCII } catch { }" 2>nul
|
||||
|
||||
REM Display menu
|
||||
set INDEX=0
|
||||
@@ -157,7 +156,7 @@ cls
|
||||
echo /// Executing: !DISPLAY[%CHOICE%]!
|
||||
echo.
|
||||
|
||||
set "SCRIPT_URL=https://git.weektab.org/companas/batchr/raw/branch/main/!SCRIPT_PATH!/!SCRIPT_NAME[%CHOICE%]!"
|
||||
set "SCRIPT_URL=https://git.weektab.org/nexus/HyperCLI/raw/branch/main/!SCRIPT_PATH!/!SCRIPT_NAME[%CHOICE%]!"
|
||||
set "TEMP_SCRIPT=%TEMP%\batch_script_%RANDOM%.bat"
|
||||
|
||||
echo Downloading script...
|
||||
Reference in New Issue
Block a user