From Newsgroup: alt.comp.os.windows-11
Herbert Kleebauer wrote:
On 1/22/2026 12:25 AM, knuttle wrote:
I periodically find I will find something on my computer, that I would
like to use on my phone.
I would like to highlight the information and transfer it to my
cellphone, so I could use as a note (I have the NotePad program on the
phone), or copy it to place in a text message.
If you already use WhatsApp on both devices, just open a chat
with yourself. Everything you enter in one devices is also available
on the other device.
Hi Herbert,
Using only FOSS tools, my Windows and Android clipboard are one and the
same where control+v dumps one clipboard & mouse-right-click dumps another.
In fact, you helped me a lot to improve the flow where over Wi-Fi or USB,
the clipboard is one-click perfectly seamless between Windows & Android.
Hence, I thank you for helping me when you helped me with the code below, where even without your neat trick to hide the console, the solution is so wonderful that I'm surprised at all the convoluted methods being proposed.
THANK YOU for helping me hide the console in this simple script below.
@echo off
REM
REM Download screencopy onto your PC <
https://scrcpy.org/>
REM Set Android "Developer Options" "USB debugging = On"
REM Then plug the Android phone into the USB port of Windows
REM Then run "scrcpy -s SERIALNUMBER" on the Win/Mac/Linux PC
REM This will mirror Android onto your Win/Mac/Linux PC
REM But scrcpy leaves an annoying console behind, by default
REM The entire point of this script is to run that one command
REM But WITHOUT leaving an empty console behind on Windows.
REM
REM C:\app\editor\android\scrcpy\showwin.bat
REM adb mdns services
REM List of discovered mdns services
REM netstat -ano -p tcp | findstr "192.168.1.10"
REM TCP 192.168.1.27:15919 192.168.1.10:41913 ESTABLISHED 7904
REM
cd /d "c:\app\editor\android\scrcpy"
REM embedded certificate block is an executable encoded within the batch file!
REM Extract embedded executable from script using certutil decode
REM Reads the batch file itself (%~f0) as encoded source content
REM Decodes certificate block at the bottom and writes showwin.exe
REM -f forces overwrite if showwin.exe already exists
REM Output is suppressed using >nul to keep console clean
REM showwin.exe is used to hide the console window temporarily
REM The batch file launches scrcpy to mirror your phone.
REM Normally, this leaves a blank console window hanging open.
REM The command showwin.exe 0 is run right after launching scrcpy.
REM This executable finds the console window and hides it from view.
REM When you're done and close scrcpy, the script runs showwin.exe 5
REM which makes the console visible again briefly to clean up.
REM Showwin searches for the window with the class "ConsoleWindowClass"
REM (that's how Windows identifies command windows).
REM Uses a system call (like ShowWindow() in Win32 API) to make it invisible.
REM It doesn't actually kill or close the window.
REM It just makes it vanish visually while scrcpy runs
REM So you’re left with a clean screen showing only your mirrored phone.
certutil -f -decode %~f0 showwin.exe>nul
REM Port 5555 was needed when you established adb connections over USB
REM And then you disconnected the USB cable to subsequently work on Wi-Fi
REM But as of Android 11 or 12, you can establish the connection over Wi-Fi
REM But that "Developer option" "Wireless debugging" port is assigned by Android!
REM So you have to get it on Android or on Windows to know what it is
REM adb connect 192.168.1.10:5555
REM You can get the current port from the following command
REM c:\> netstat -ano -p tcp | findstr "192.168.1.10"
REM
REM maybe we do NOT need this command after all???
REM adb connect 192.168.1.10:41913
REM
:: now we hide console window
showwin.exe 0
REM
REM scrcpy --always-on-top --tcpip=192.168.1.10:5555
REM Maybe we can then remove the IP:PORT after all???
REM scrcpy --always-on-top --tcpip=192.168.1.10:41913
REM We don't really need --always-on-top after all???
REM scrcpy --always-on-top
REM scrcpy
REM scrcpy -s adb-RFCR50V7YVY-kFSyj8._adb-tls-connect._tcp.
REM scrcpy -s 192.168.1.21
REM Enter your Android serial number below
scrcpy -s GFCR56AMEBA
REM
:: after scrcpy is closed we show console window again
showwin.exe 5
REM
del showwin.exe
goto :eof
REM
-----BEGIN CERTIFICATE-----
TVpgAQEAAAAEAAAA//8AAGABAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAoAAAAA4fug4AtAnNIbgBTM0hTmljZSB0byBtZWV0IHNvbWVi
b2R5IHdobyBpcyBzdGlsbCB1c2luZyBET1MsDQpidXQgdGhpcyBwcm9ncmFtIHJl
cXVpcmVzIFdpbjMyLg0KJFBFAABMAQEAUHmlNgAAAAAAAAAA4AAPAQsBBQwAAgAA
AAAAAAAAAADIEAAAABAAAAAgAAAAAEAAABAAAAACAAAFAAAAAAAAAAQAAAAAAAAA
ACAAAAACAAA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