-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_shortcuts_simple.bat
More file actions
77 lines (69 loc) · 2.74 KB
/
Copy pathcreate_shortcuts_simple.bat
File metadata and controls
77 lines (69 loc) · 2.74 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
@echo off
chcp 65001 >nul
echo ========================================
echo Creating HotMic Shortcuts
echo ========================================
echo.
REM Get current directory
set "PROJECT_DIR=%~dp0"
set "PROJECT_DIR=%PROJECT_DIR:~0,-1%"
REM Find Python
set "PYTHON_EXE="
if exist "%PROJECT_DIR%\.venv\Scripts\python.exe" (
set "PYTHON_EXE=%PROJECT_DIR%\.venv\Scripts\python.exe"
echo Using virtual environment Python
) else (
where python >nul 2>&1
if %ERRORLEVEL% EQU 0 (
for /f "delims=" %%i in ('where python') do set "PYTHON_EXE=%%i"
echo Using system Python
) else (
echo Error: Python not found!
pause
exit /b 1
)
)
REM Create launch script
echo Creating launch_hotmic.bat...
(
echo @echo off
echo cd /d "%PROJECT_DIR%"
echo "%PYTHON_EXE%" hotmic.py
echo pause
) > "%PROJECT_DIR%\launch_hotmic.bat"
REM Create hidden launch script
echo Creating launch_hotmic_hidden.vbs...
(
echo Set WshShell = CreateObject^("WScript.Shell"^)
echo WshShell.CurrentDirectory = "%PROJECT_DIR%"
echo WshShell.Run """%PYTHON_EXE%""" hotmic.py", 0, False
echo Set WshShell = Nothing
) > "%PROJECT_DIR%\launch_hotmic_hidden.vbs"
REM Create desktop shortcuts using PowerShell
echo Creating desktop shortcuts...
powershell -Command "$ws = New-Object -ComObject WScript.Shell; $s = $ws.CreateShortcut('%USERPROFILE%\Desktop\HotMic.lnk'); $s.TargetPath = '%PROJECT_DIR%\launch_hotmic.bat'; $s.WorkingDirectory = '%PROJECT_DIR%'; $s.Description = 'HotMic Speech-to-Text'; $s.Save()"
powershell -Command "$ws = New-Object -ComObject WScript.Shell; $s = $ws.CreateShortcut('%USERPROFILE%\Desktop\HotMic (Background).lnk'); $s.TargetPath = '%PROJECT_DIR%\launch_hotmic_hidden.vbs'; $s.WorkingDirectory = '%PROJECT_DIR%'; $s.Description = 'HotMic Speech-to-Text (Background)'; $s.Save()"
REM Create start menu shortcut
echo Creating start menu shortcut...
powershell -Command "$ws = New-Object -ComObject WScript.Shell; $s = $ws.CreateShortcut('%APPDATA%\Microsoft\Windows\Start Menu\Programs\HotMic.lnk'); $s.TargetPath = '%PROJECT_DIR%\launch_hotmic.bat'; $s.WorkingDirectory = '%PROJECT_DIR%'; $s.Description = 'HotMic Speech-to-Text'; $s.Save()"
echo.
echo ========================================
echo Shortcuts created successfully!
echo ========================================
echo.
echo Created shortcuts:
echo 1. Desktop - HotMic.lnk (with console)
echo 2. Desktop - HotMic (Background).lnk (hidden)
echo 3. Start Menu - HotMic.lnk
echo.
echo How to use:
echo - Double-click desktop icon to launch
echo - Search 'HotMic' in Start Menu
echo - Pin shortcut to taskbar
echo.
echo Set global hotkey:
echo 1. Right-click shortcut - Properties
echo 2. In 'Shortcut key' field, press desired key combo
echo 3. Click OK
echo.
pause