Created
June 7, 2025 09:35
-
-
Save SanMurakami/577cd3e1fd0661b1277729ca7eeafc50 to your computer and use it in GitHub Desktop.
Windowsお仕事とプライベートでCursorエディタのアカウントを簡単に切り替えたい人向け
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| setlocal EnableDelayedExpansion | |
| rem ====================================== | |
| rem 設定部分(必要に応じて変更してください) | |
| rem ====================================== | |
| set "SUFFIX1=Private" | |
| set "SUFFIX2=Work" | |
| set "DEFAULT_SUFFIX=%SUFFIX1%" | |
| rem ====================================== | |
| set "BASE_DIR=%APPDATA%" | |
| set "APP_DIR=%BASE_DIR%\Cursor" | |
| set "DIR1=%BASE_DIR%\Cursor_%SUFFIX1%" | |
| set "DIR2=%BASE_DIR%\Cursor_%SUFFIX2%" | |
| set "CURSOR_EXE=%LOCALAPPDATA%\Programs\cursor\Cursor.exe" | |
| taskkill /IM Cursor.exe /F >nul 2>&1 | |
| timeout /T 1 >nul | |
| if exist "%DIR1%" ( | |
| if exist "%APP_DIR%" ( | |
| move /Y "%APP_DIR%" "%DIR2%" | |
| ) | |
| move /Y "%DIR1%" "%APP_DIR%" | |
| ) else if exist "%DIR2%" ( | |
| if exist "%APP_DIR%" ( | |
| move /Y "%APP_DIR%" "%DIR1%" | |
| ) | |
| move /Y "%DIR2%" "%APP_DIR%" | |
| ) else ( | |
| move /Y "%APP_DIR%" "%BASE_DIR%\Cursor_%DEFAULT_SUFFIX%" | |
| start "" "%CURSOR_EXE%" | |
| exit /B | |
| ) | |
| start "" "%CURSOR_EXE%" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment