diff --git a/files/network-ping-tool.bat b/files/network-ping-tool.bat new file mode 100644 index 0000000..5d35163 --- /dev/null +++ b/files/network-ping-tool.bat @@ -0,0 +1,54 @@ +@echo off +REM === Interactive Ping Tool === +echo ======================================== +echo Network Ping Tool +echo ======================================== +echo. + +REM Prompt for target (website or server IP) +set /p TARGET="Enter website or server IP to ping: " + +REM Validate input +if "%TARGET%"=="" ( + echo. + echo ERROR: No target specified! + pause + exit /b 1 +) + +REM Prompt for ping mode +echo. +echo Ping Mode: +echo [1] Single ping test (4 packets) +echo [2] Continuous ping (until stopped with Ctrl+C) +echo. +set /p MODE="Select mode (1 or 2): " + +echo. +echo ======================================== +echo Starting ping to: %TARGET% +echo ======================================== +echo. + +REM Execute ping based on selected mode +if "%MODE%"=="1" ( + echo Mode: Single test - sending 4 packets... + echo. + ping -n 4 %TARGET% + echo. + echo ======================================== + echo Ping test completed! + echo ======================================== +) else if "%MODE%"=="2" ( + echo Mode: Continuous ping - Press Ctrl+C to stop + echo. + ping -t %TARGET% +) else ( + echo. + echo ERROR: Invalid selection! Please choose 1 or 2. + pause + exit /b 1 +) + +echo. +pause \ No newline at end of file diff --git a/files/system-information-tool.bat b/files/system-information-tool.bat new file mode 100644 index 0000000..03efd98 --- /dev/null +++ b/files/system-information-tool.bat @@ -0,0 +1,174 @@ +@echo off +REM === System Information Tool === +echo ======================================== +echo System Information Tool +echo ======================================== +echo. +echo Select information category: +echo. +echo [1] Quick Overview (System Summary) +echo [2] Hardware Information (CPU, RAM, Motherboard) +echo [3] Storage Information (Disks, Partitions) +echo [4] Network Information (IP, Adapters, Connections) +echo [5] Operating System Details +echo [6] Running Processes and Services +echo [7] Graphics Card Information +echo [8] Battery Status (Laptops only) +echo [9] Complete System Report (All Information) +echo [0] Export Report to File +echo. +set /p CHOICE="Enter your choice (0-9): " + +echo. +echo ======================================== + +if "%CHOICE%"=="1" goto QUICK_OVERVIEW +if "%CHOICE%"=="2" goto HARDWARE +if "%CHOICE%"=="3" goto STORAGE +if "%CHOICE%"=="4" goto NETWORK +if "%CHOICE%"=="5" goto OS_INFO +if "%CHOICE%"=="6" goto PROCESSES +if "%CHOICE%"=="7" goto GRAPHICS +if "%CHOICE%"=="8" goto BATTERY +if "%CHOICE%"=="9" goto COMPLETE +if "%CHOICE%"=="0" goto EXPORT +goto INVALID + +:QUICK_OVERVIEW +echo System Overview +echo ======================================== +systeminfo | findstr /C:"Host Name" /C:"OS Name" /C:"OS Version" /C:"System Type" /C:"Total Physical Memory" /C:"System Manufacturer" /C:"System Model" +goto END + +:HARDWARE +echo Hardware Information +echo ======================================== +echo. +echo === Processor === +wmic cpu get name,numberofcores,maxclockspeed +echo. +echo === Memory === +wmic memorychip get capacity,speed,manufacturer +echo. +echo === Motherboard === +wmic baseboard get manufacturer,product,version +goto END + +:STORAGE +echo Storage Information +echo ======================================== +echo. +echo === Disk Drives === +wmic diskdrive get model,size,status +echo. +echo === Partitions and Free Space === +wmic logicaldisk get deviceid,volumename,size,freespace,filesystem +goto END + +:NETWORK +echo Network Information +echo ======================================== +echo. +echo === IP Configuration === +ipconfig +echo. +echo === Network Adapters === +wmic nic get name,netconnectionstatus,speed +echo. +echo === Active Connections === +netstat -an | findstr ESTABLISHED +goto END + +:OS_INFO +echo Operating System Details +echo ======================================== +systeminfo | findstr /C:"OS" /C:"System Boot Time" /C:"Windows Directory" /C:"System Directory" /C:"Boot Device" +echo. +echo === Installed Hotfixes === +wmic qfe list brief +goto END + +:PROCESSES +echo Running Processes and Services +echo ======================================== +echo. +echo === Top Processes by Memory === +tasklist /FI "STATUS eq running" | sort /R /+63 +echo. +echo === Running Services === +net start +goto END + +:GRAPHICS +echo Graphics Card Information +echo ======================================== +wmic path win32_VideoController get name,adapterram,driverversion,currentrefreshrate,videoprocessor +goto END + +:BATTERY +echo Battery Status +echo ======================================== +wmic path win32_battery get estimatedchargeremaining,estimatedruntime,batterystatus +if errorlevel 1 ( + echo No battery detected - this might be a desktop computer. +) +goto END + +:COMPLETE +echo Complete System Report +echo ======================================== +echo Generating comprehensive system information... +echo This may take a moment... +echo. +systeminfo +echo. +echo ======================================== +echo Hardware Details +echo ======================================== +wmic cpu get name,numberofcores,maxclockspeed +wmic memorychip get capacity,speed +wmic diskdrive get model,size +wmic path win32_VideoController get name,adapterram +goto END + +:EXPORT +echo Export System Report +echo ======================================== +set FILENAME=SystemReport_%date:~-4,4%%date:~-7,2%%date:~-10,2%_%time:~0,2%%time:~3,2%.txt +set FILENAME=%FILENAME: =0% +echo Generating report and saving to: %FILENAME% +echo. +( + echo ======================================== + echo SYSTEM INFORMATION REPORT + echo Generated: %date% %time% + echo ======================================== + echo. + systeminfo + echo. + echo ======================================== + echo HARDWARE INFORMATION + echo ======================================== + wmic cpu get name,numberofcores,maxclockspeed + wmic memorychip get capacity,speed + wmic diskdrive get model,size + wmic path win32_VideoController get name,adapterram + echo. + echo ======================================== + echo NETWORK INFORMATION + echo ======================================== + ipconfig /all +) > %FILENAME% +echo. +echo Report saved successfully to: %FILENAME% +goto END + +:INVALID +echo ERROR: Invalid selection! Please choose 0-9. +goto END + +:END +echo. +echo ======================================== +echo. +pause \ No newline at end of file diff --git a/menu-launcher.bat b/menu-launcher.bat new file mode 100644 index 0000000..80a0387 --- /dev/null +++ b/menu-launcher.bat @@ -0,0 +1,203 @@ +@echo off +REM === Dynamic Batch Scripts Menu Launcher === +REM Repository: https://git.weektab.org/companas/batch-scripts + +setlocal enabledelayedexpansion + +:MENU +cls +echo ======================================== +echo Batch Scripts Menu - Dynamic Loader +echo ======================================== +echo. +echo Scanning /files directory... +echo. + +REM Use Gitea API to list files in /files directory +powershell -Command "$ProgressPreference = 'SilentlyContinue'; try { $response = Invoke-RestMethod -Uri 'https://git.weektab.org/api/v1/repos/companas/batch-scripts/contents/files'; $batFiles = $response | Where-Object { $_.name -like '*.bat' } | Select-Object -ExpandProperty name; 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 + pause + exit /b 1 +) + +REM Check for errors +set "FIRST_LINE=" +for /f "delims=" %%a in (%TEMP%\repo_scripts.txt) do ( + set "FIRST_LINE=%%a" + goto :check_error +) +:check_error + +if "%FIRST_LINE%"=="ERROR" ( + echo ERROR: API request failed + pause + exit /b 1 +) + +if "%FIRST_LINE%"=="NONE" ( + echo No .bat files found in /files directory! + pause + exit /b 1 +) + +REM Display menu +set INDEX=0 +for /f "delims=" %%a in (%TEMP%\repo_scripts.txt) do ( + set "LINE=%%a" + if not "!LINE!"=="" ( + set /a INDEX+=1 + set "SCRIPT_NAME[!INDEX!]=!LINE!" + + REM Format display name (remove .bat and replace separators) + set "DISPLAY=!LINE:.bat=!" + set "DISPLAY=!DISPLAY:-= !" + set "DISPLAY=!DISPLAY:_= !" + + echo [!INDEX!] !DISPLAY! + ) +) + +set TOTAL_SCRIPTS=%INDEX% + +if %TOTAL_SCRIPTS%==0 ( + echo No .bat files found! + pause + exit /b 1 +) + +echo. +echo [P] Ping Tool +echo [S] System Information +echo [R] Refresh List +echo [0] Exit +echo. +echo ======================================== +set /p CHOICE="Select option: " + +if /i "%CHOICE%"=="P" goto PING_TOOL +if /i "%CHOICE%"=="S" goto SYSTEM_INFO +if /i "%CHOICE%"=="R" goto MENU +if "%CHOICE%"=="0" goto EXIT + +REM Validate selection +set "VALID=0" +for /l %%i in (1,1,%TOTAL_SCRIPTS%) do ( + if "%CHOICE%"=="%%i" set "VALID=1" +) + +if "%VALID%"=="0" ( + echo Invalid selection! + timeout /t 2 >nul + goto MENU +) + +REM Execute script +cls +echo ======================================== +echo Executing: !SCRIPT_NAME[%CHOICE%]! +echo ======================================== +echo. + +set "SCRIPT_URL=https://git.weektab.org/companas/batch-scripts/raw/branch/main/files/!SCRIPT_NAME[%CHOICE%]!" +set "TEMP_SCRIPT=%TEMP%\batch_script_%RANDOM%.bat" + +echo Downloading script... +powershell -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri '!SCRIPT_URL!' -OutFile '%TEMP_SCRIPT%'" 2>nul + +if not exist "%TEMP_SCRIPT%" ( + echo ERROR: Download failed! + echo URL: !SCRIPT_URL! + pause + goto MENU +) + +echo Script downloaded successfully! +echo. +echo ======================================== +call "%TEMP_SCRIPT%" + +if exist "%TEMP_SCRIPT%" del "%TEMP_SCRIPT%" 2>nul + +echo. +echo ======================================== +echo Completed! +echo ======================================== +pause +goto MENU + +:PING_TOOL +cls +echo ======================================== +echo Ping Tool +echo ======================================== +echo. +set /p TARGET="Enter target (IP or domain): " +if "%TARGET%"=="" goto MENU + +echo. +echo [1] Single test (4 packets) +echo [2] Continuous (Ctrl+C to stop) +echo. +set /p MODE="Mode: " + +echo. +if "%MODE%"=="1" ( + ping -n 4 %TARGET% +) else if "%MODE%"=="2" ( + ping -t %TARGET% +) else ( + echo Invalid mode! +) +echo. +pause +goto MENU + +:SYSTEM_INFO +cls +echo ======================================== +echo System Information +echo ======================================== +echo. +echo [1] Quick Overview +echo [2] Hardware +echo [3] Storage +echo [4] Network +echo [5] Complete Report +echo. +set /p SYSCHOICE="Select: " + +echo. +if "%SYSCHOICE%"=="1" ( + systeminfo | findstr /C:"Host Name" /C:"OS Name" /C:"OS Version" /C:"System Type" /C:"Total Physical Memory" +) else if "%SYSCHOICE%"=="2" ( + echo === CPU === + wmic cpu get name,numberofcores,maxclockspeed + echo. + echo === Memory === + wmic memorychip get capacity,speed,manufacturer +) else if "%SYSCHOICE%"=="3" ( + echo === Disks === + wmic diskdrive get model,size,status + echo. + echo === Partitions === + wmic logicaldisk get deviceid,volumename,size,freespace +) else if "%SYSCHOICE%"=="4" ( + ipconfig +) else if "%SYSCHOICE%"=="5" ( + systeminfo +) else ( + echo Invalid! +) +echo. +pause +goto MENU + +:EXIT +if exist "%TEMP%\repo_readme.md" del "%TEMP%\repo_readme.md" 2>nul +if exist "%TEMP%\repo_scripts.txt" del "%TEMP%\repo_scripts.txt" 2>nul +cls +echo Goodbye! +timeout /t 1 >nul +exit \ No newline at end of file