Skip to content

Commit

Permalink
Add a shorcut "open a terminal here" on Windows
Browse files Browse the repository at this point in the history
On Windows, the file explorer does not provide any "open a terminal
here" shortcut.

Add a bat file which just runs `cmd` to easily open a terminal directly
in the scrcpy directory (so there is no need to `cd C:\path\…`).

PR #2970 <#2970>
  • Loading branch information
rom1v committed Jan 27, 2022
1 parent c8dc191 commit 50f4f16
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
11 changes: 9 additions & 2 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,15 @@ Caused by: java.lang.IllegalArgumentException: displayToken must not be null
## Command line on Windows
Some Windows users are not familiar with the command line. Here is how to open a
terminal and run `scrcpy` with arguments:
Since v1.22, a "shortcut" has been added to directly open a terminal in the
scrcpy directory. Double-click on `open_a_terminal_here.bat`, then type your
command. For example:
```
scrcpy --record file.mkv
```
You could also open a terminal and go to the scrcpy folder manually:
1. Press <kbd>Windows</kbd>+<kbd>r</kbd>, this opens a dialog box.
2. Type `cmd` and press <kbd>Enter</kbd>, this opens a terminal.
Expand Down
1 change: 1 addition & 0 deletions data/open_a_terminal_here.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@cmd
2 changes: 2 additions & 0 deletions release.mk
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ dist-win32: build-server build-win32
cp data/scrcpy-console.bat "$(DIST)/$(WIN32_TARGET_DIR)"
cp data/scrcpy-noconsole.vbs "$(DIST)/$(WIN32_TARGET_DIR)"
cp data/icon.png "$(DIST)/$(WIN32_TARGET_DIR)"
cp data/open_a_terminal_here.bat "$(DIST)/$(WIN32_TARGET_DIR)"
cp prebuilt-deps/ffmpeg-4.3.1-win32-shared/bin/avutil-56.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
cp prebuilt-deps/ffmpeg-4.3.1-win32-shared/bin/avcodec-58.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
cp prebuilt-deps/ffmpeg-4.3.1-win32-shared/bin/avformat-58.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
Expand All @@ -110,6 +111,7 @@ dist-win64: build-server build-win64
cp data/scrcpy-console.bat "$(DIST)/$(WIN64_TARGET_DIR)"
cp data/scrcpy-noconsole.vbs "$(DIST)/$(WIN64_TARGET_DIR)"
cp data/icon.png "$(DIST)/$(WIN64_TARGET_DIR)"
cp data/open_a_terminal_here.bat "$(DIST)/$(WIN64_TARGET_DIR)"
cp prebuilt-deps/ffmpeg-5.0-full_build-shared/bin/avutil-57.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
cp prebuilt-deps/ffmpeg-5.0-full_build-shared/bin/avcodec-59.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
cp prebuilt-deps/ffmpeg-5.0-full_build-shared/bin/avformat-59.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
Expand Down

0 comments on commit 50f4f16

Please sign in to comment.