-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExtract-Icon-Interactive.bat
More file actions
80 lines (65 loc) · 2.17 KB
/
Extract-Icon-Interactive.bat
File metadata and controls
80 lines (65 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
@echo off
setlocal enabledelayedexpansion
:: Interactive icon extraction tool
:menu
cls
echo ====================================
echo Icon Extractor - Interactive Menu
echo ====================================
echo.
echo 1. Extract as ICO (for shortcuts)
echo 2. Extract as PNG (for Company Portal)
echo 3. Extract both ICO and PNG
echo 4. Exit
echo.
set /p choice="Select option (1-4): "
if "%choice%"=="4" exit /b 0
echo.
set /p exepath="Enter full path to executable: "
if not exist "%exepath%" (
echo.
echo ERROR: File not found!
pause
goto menu
)
echo.
set /p outpath="Enter output directory (or press Enter for current folder): "
if "%outpath%"=="" set "outpath=%~dp0Icons"
if not exist "%outpath%" mkdir "%outpath%"
echo.
echo Processing...
echo.
if "%choice%"=="1" (
powershell.exe -ExecutionPolicy Bypass -NoProfile -File "%~dp0Extract-Icon.ps1" -SourceExe "%exepath%" -OutputPath "%outpath%" -SaveAsIco
) else if "%choice%"=="2" (
powershell.exe -ExecutionPolicy Bypass -NoProfile -File "%~dp0Extract-Icon.ps1" -SourceExe "%exepath%" -OutputPath "%outpath%" -SaveAsPng
) else if "%choice%"=="3" (
powershell.exe -ExecutionPolicy Bypass -NoProfile -File "%~dp0Extract-Icon.ps1" -SourceExe "%exepath%" -OutputPath "%outpath%" -SaveAsIco -SaveAsPng
) else (
echo Invalid choice!
pause
goto menu
)
echo.
echo Done! Icons saved to: %outpath%
echo.
set /p again="Extract another icon? (Y/N): "
if /i "%again%"=="Y" goto menu
exit /b 0
```
**Setup Instructions:**
1. Save the PowerShell script as `Extract-Icon.ps1`
2. Save any/all of the batch files in the same directory
3. For drag-and-drop usage: Just drag an .exe file onto `Extract-Icon-ICO.bat`, `Extract-Icon-PNG.bat`, or `Extract-Icon-Both.bat`
4. For batch processing: Edit `Extract-Icon-Batch-Process.bat` to include your commonly packaged applications
5. For interactive use: Run `Extract-Icon-Interactive.bat`
**Recommended folder structure:**
```
C:\Tools\IconExtractor\
├── Extract-Icon.ps1
├── Extract-Icon-ICO.bat
├── Extract-Icon-PNG.bat
├── Extract-Icon-Both.bat
├── Extract-Icon-Batch-Process.bat
├── Extract-Icon-Interactive.bat
└── Icons\ (auto-created)