-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.bat
More file actions
20 lines (15 loc) · 781 Bytes
/
setup.bat
File metadata and controls
20 lines (15 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
@echo off
SETLOCAL
REM === Path to your compiled EXE ===
set "AppPath=%~dp0AudioSwapper.exe"
REM === Get the current user's Startup folder ===
set "StartupFolder=%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup"
REM === Shortcut path ===
set "ShortcutPath=%StartupFolder%\AudioSwapper.lnk"
REM === Create shortcut using PowerShell (single line) ===
powershell -NoProfile -Command "$WshShell = New-Object -ComObject WScript.Shell; $Shortcut = $WshShell.CreateShortcut('%ShortcutPath%'); $Shortcut.TargetPath = '%AppPath%'; $Shortcut.WorkingDirectory = '%~dp0'; $Shortcut.Save()"
echo Shortcut created in Startup folder.
echo AudioSwapper.exe will now start on computer startup.
echo See startup programs with Win+R --^> shell:startup.
pause
ENDLOCAL