And also, as I use both computers for different things, when at home I started to need to regularly be able to do all things when I am at home and switching between computers became frustrating because I am using one, and interfacing with it through its keyboard and mouse and then I need to use the other computer suddenly and often even switch back quickly or maybe not, but then it wouldn't be working, no inputs I enter are working on the other computer I am now using, why? And then after several attempts to see why things aren't working and checking this and that and so on I then realize it was the simplest and stupidest thing, that I simply didn't move to using the other mouse and keyboard. Plus the extra mouse and keyboard really cluttered things, one works, another doesn't always some problem. So I introduced Mouse without Boarders from Microsoft. And it worked, most of the time. I was so happy at first.
Sometime late last year I also finally managed to get a script to deactivate WireGuard so when I got home and it was activated, it would automatically deactivate once the laptop noticed the Ip address had changed to one of two DHCP reserved IP addresses which one was used only for WIFI and the other only when wired in over ethernet because they are different adapters and don't share IP addresses. So I reserved them on my router and now it always assigns my laptop the same IP for ethernet and the same IP for WIFI.
Then I struggled with countless different scripts to get all of these things I managed to fix to reconnect or whatever. Most of those scripts had mixed success. Even now, like a few weeks ago, I finally created a very simple script that is just the keyboard shortcut to reconnect Mouse Without Borders, since the internet connection over ethernet is finicky. I only partially know why and I've done what I can think to in order to solve that and it is only part of the issue anyway so it doesn't really resolve it at all. It still disconnects all the time even with that issue mitigated.
Before I created this simpler script, I had to have MWB open all the time on my laptop and I would press the connect button with quite some regularity, but it seemed to be slightly more stable before I created this simple script to press the reconnect button without the MWB window actually being open. This should in no way affect its stability, but the stability has declined since I did this. I often have to run this script to reconnect even more than I used to have to press that button on the app before. It's like ten or twenty percent worse than it was. And it isn't consistent either so that math is hard to do at all with any accuracy.
Well, today I had a brilliant breakthrough idea that solves the constant MWB disconnect issue almost entirely as far as I can tell. I already tried MWB alternatives, I switched from PowerToys MWB to Microsoft Garage MWB, thinking the garage version might have cli controls, which turned out to be wrong. But the problem I then had changed in a way that without eliminating the problem, at least made it a little easier. I had to reconnect all the time in PowerToys through my laptops mouse because it is the way I work on my desktop but the reconnect button had to be pressed on a disconnected desktop. Now with the garage version, it switched to me needing to press it on the laptop, which is where I am controlling my desktop from so that made it way easier. But now I had a bright, blinding window I had to keep open at all times when home so I could constantly reconnect. I looked at ways of concealing the rest of the window and only having this floating button by using PowerToys to cut up the window, which didn't work, and I found alternatives but this was digging into the weeds too much for such a ridiculous thing.
The stability issue seems to go completely away if I only use WIFI, but when I am home, I want the benefits of ethernet, it is way faster and there will be no connection issues that I am aware of that would make games crash or anything. I simply have less issues wired, but only for everything other than MWB. MWB is highly sensitive to the slightest tingle, if it even thinks there is a connection issue it jumps to conclusions and convulses into a tonic-clonic seizure, blacking out, dropping on the floor, and shakes all over the place. A computer somehow does this.
So my breakthrough today is that I researched if I could sort of do the equivalent of a VPN split tunnel where only certain applications do or don't use the VPN, but this is without a VPN. I just want this certain application to route all its network traffic over WIFI even if ethernet is connected. I tried to figure if there could possibly be any adverse affects and I concluded if for whatever reason you connected to your ethernet and it was down or didn't connect to ethernet at all and WIFI was also down or turned off when at home...and I thought ooh, that could be bad and that does happen occasionally. Oh wait, I wouldn't have internet either, or any network connection. And I would probably notice that before or very shortly after discovering MWB is down. Okay so that's not that bad and then I thought but even if not concerned about that, I what if I intentionally turned WIFI off and still needed MWB, does that ever happen? Yes, when I am testing stuff like my VPM functionality when troubleshooting. This actually happens more often than I would like. And I think I do it for other reasons too, and I plug my laptop to my hotspot, and turn WIFI off.
And I then had a thought, well, is there any way to just have the connection for MWB default back to ethernet if WIFI is down? And I think it can. I was so pleased with myself. The initial routing thing was quickly and easily solved. This would almost certainly remove the need for my simple reconnect script because the connection will just be stable now. I guess I will keep it for good measure, it may still occasionally be needed, or even rarely. So now to get it to default back to ethernet only when WIFI is down.
Okay that is done. It worked.
Incidentally I started todays journey by trying to fix the fact that even though I set all sorts of Task Scheduler items to run silently, they still produce blue PowerShell windows that always interrupt what I am doing so it makes it harder tog et work done, I get frustrated sometimes and minimize them because they often hang, and then I get irritated again when they seem to hang so I go to minimize and they then disappear right before I click the minimize button. So I went into Task Scheduler, I turned off all the things that were producing blue windows such as a WireGuard auto disconnect all tunnels script when the IP address changes, another one of the things that I felt good about around last September or something like that, and it worked for a while and then stopped working after several months. I don't know why it worked at all because the fix was in the Task, inside Actions, under Arguments, I had a "-ExecutionPolicy Bypass -WindowsStyle Hidden -File "C:\Scripts\# wg-activate-half-on-public.ps1" and the answer was simply to remove the lowercase "s" between -Window and Style, and it worked great.
The ps1 script was :
"# wg-stop.ps1
$homeIPs = @("192.168.50.146","192.168.50.65")
# Get active IPv4 addresses on real adapters
$activeIPs = Get-NetIPAddress -AddressFamily IPv4 | Where-Object {
$_.InterfaceAlias -notmatch "Loopback|vEthernet|VirtualBox|WSL|WireGuard" -and
$_.AddressState -eq "Preferred"
} | Select-Object -ExpandProperty IPAddress
# If any home IP is active, stop tunnels
if ($activeIPs | Where-Object { $homeIPs -contains $_ }) {
Stop-Service 'WireGuardTunnel$private-VPN-full' -Force -ErrorAction SilentlyContinue
Stop-Service 'WireGuardTunnel$public-VPN-half-tunnel' -Force -ErrorAction SilentlyContinue
Write-Output "WireGuard tunnels stopped for home network IP."
} else {
Write-Output "Not on home network. Active IPs: $($activeIPs -join ', ')"
}"
Then to make it actually silent, I tried to create a VBS script that did the same thing without success, and I knew that I could use VBS to then activate another script silently, so I did that, I simply inserted the VBS script into the PowerShell script place in Task Scheduler, left the original script in the spot on my C drive that I had it in the first place, but then also added the VBS script and made it point to the PowerShell Script. Problem solved.
Program/Script: wscript.exe, Add Arguments: "C:\Scripts\stop.vbs"
"CreateObject("WScript.Shell").Run "powershell.exe -NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -File ""C:\Scripts\wg-stop-home.ps1""", 0, False"
WireGuard deactivation tunnels that worked properly in the cli without scripts for my case were "Stop-Service 'WireGuardTunnel$private-VPN-full' -Force" and
"Stop-Service 'WireGuardTunnel$public-VPN-half-tunnel' -Force"
I used:
"route print 192.168.50.208"
as a diagnostic command that lets me verify the route is actually active and pointing to a certain interface. You know if like when you go IPCONFIG and you see all sorts of different network adapters have a number, that's the interface number. And my WIFI interface has a different one than my Ethernet one does. I ran:
"route add 192.168.50.208 mask 255.255.255.255 192.168.50.1 metric 1 if ,WIFI network adapter number>"
to change the route MWB took to contact my desktop from Ethernet to WIFI. Then decided I wanted to default back to Ethernet if WIFI wasnt working for any reason using:
" "if ((Get-NetAdapter -InterfaceIndex 23).Status -eq "Up") { route add 192.168.50.208 mask 255.255.255.255 192.168.50.1 metric 1 if <WIFI network adapter number> 2>$null } else { route delete 192.168.50.208 2>$null }""
The deletion of the new route is temporary if that case is actually ever met. But if I need to undo this change altogether the fix is simple:
"route delete 192.168.50.208"
I decided to keep my AHK script that I was using until today to reconnect without the MWB interface:
"#SingleInstance Force
SendInput ^!r
Sleep, 50
ExitApp"
just in case I need it again for whatever reason. I won't remember that command, I already have so many I must try to keep track of, I thought I would reduce the burden because when this happens it is often amidst frustration. No need to mistype the keyboard command while I am already dealing with another problem.
Now I had realized that if WIFI was ever down for any reason at all, that I wanted the route to automatically switch to Ethernet and I already had a script that sensed when the IP address changed from any address to either the reserved WIFI address or the reserved Ethernet address, and so I updated the ps1 script to also help with sensing the loss of WIFI:
"# wg-stop-home.ps1
$homeIPs = @("192.168.50.146","192.168.50.65")
# Get active IPv4 addresses on real adapters
$activeIPs = Get-NetIPAddress -AddressFamily IPv4 | Where-Object {
$_.InterfaceAlias -notmatch "Loopback|vEthernet|VirtualBox|WSL|WireGuard" -and
$_.AddressState -eq "Preferred"
} | Select-Object -ExpandProperty IPAddress
# If any home IP is active, stop tunnels
if ($activeIPs | Where-Object { $homeIPs -contains $_ }) {
Stop-Service 'WireGuardTunnel$private-VPN-full' -Force -ErrorAction SilentlyContinue
Stop-Service 'WireGuardTunnel$public-VPN-half-tunnel' -Force -ErrorAction SilentlyContinue
}
# Smart MWB route
if ((Get-NetAdapter -InterfaceIndex 23).Status -eq "Up") {
route add 192.168.50.208 mask 255.255.255.255 192.168.50.1 metric 1 if 23 2>$null
} else {
route delete 192.168.50.208 2>$null
}"
It worked so far as I can tell. MWB is working over WIFI but I won't know for sure this really reduces or eliminates the problem for at least a couple days. Maybe if it doesn't, I will add a trigger to then activate the AHK script somehow.
I have already been working on a script that reopens VoiceMeeter Banana fresh because it freezes almost every day at least once after long periods of disuse, and updates the audio input and sound outputs that I need in order for VoiceMeeter to do it's job because Windows tends to reset one or both of the audio inputs or outputs in the Windows 11 settings app. That's annoying, and then Macro buttons also stops working once like every couple months so the script reopens that fresh too. So anytime there is a problem at all related to VoiceMeeter on the desktop, this app fixes all three of those problems whether it needs them or not. One ring to rule them all. I use Macro Buttons, the third app in this equation, which is bundled with VoiceMeeter as a separate but associated app, and I use to make certain keyboard buttons on my keyboard turn volume up, down and mute audio. This script seems to work at least most of the time for all three problems:
"@echo off
echo Stopping Voicemeeter processes...
REM Kill all Voicemeeter-related processes
taskkill /F /IM voicemeeterbanana.exe 2>nul
taskkill /F /IM voicemeeter.exe 2>nul
taskkill /F /IM voicemeeterpro.exe 2>nul
taskkill /F /IM voicemeeter8.exe 2>nul
taskkill /F /IM voicemeeter8x64.exe 2>nul
taskkill /F /IM MacroButtons.exe 2>nul
taskkill /F /IM VoicemeeterMacroButtons.exe 2>nul
echo Waiting for processes to close...
timeout /t 2 /nobreak >nul
echo Starting Voicemeeter...
REM Start Voicemeeter Banana - try multiple possible locations
if exist "C:\Program Files\VB\Voicemeeter\voicemeeterbanana.exe" (
start "" "C:\Program Files\VB\Voicemeeter\voicemeeterbanana.exe"
echo Voicemeeter Banana started.
goto :end
)
if exist "C:\Program Files (x86)\VB\Voicemeeter\voicemeeterbanana.exe" (
start "" "C:\Program Files (x86)\VB\Voicemeeter\voicemeeterbanana.exe"
echo Voicemeeter Banana started.
goto :end
)
if exist "C:\Program Files\VB\Voicemeeter\voicemeeterpro.exe" (
start "" "C:\Program Files\VB\Voicemeeter\voicemeeterpro.exe"
echo Voicemeeter Pro started.
goto :end
)
if exist "C:\Program Files (x86)\VB\Voicemeeter\voicemeeterpro.exe" (
start "" "C:\Program Files (x86)\VB\Voicemeeter\voicemeeterpro.exe"
echo Voicemeeter Pro started.
goto :end
)
echo ERROR: Voicemeeter Banana executable not found.
echo Please right-click the Voicemeeter shortcut, select Properties, and check the Target path.
echo Then update this script with the correct path.
pause
goto :eof
:end
echo Starting Macro Buttons...
REM Start Macro Buttons - try multiple possible locations
if exist "C:\Program Files\VB\Voicemeeter\VoicemeeterMacroButtons.exe" (
start "" "C:\Program Files\VB\Voicemeeter\VoicemeeterMacroButtons.exe"
echo Macro Buttons started.
goto :done
)
if exist "C:\Program Files (x86)\VB\Voicemeeter\VoicemeeterMacroButtons.exe" (
start "" "C:\Program Files (x86)\VB\Voicemeeter\VoicemeeterMacroButtons.exe"
echo Macro Buttons started.
goto :done
)
if exist "C:\Program Files\VB\Voicemeeter\MacroButtons.exe" (
start "" "C:\Program Files\VB\Voicemeeter\MacroButtons.exe"
echo Macro Buttons started.
goto :done
)
if exist "C:\Program Files (x86)\VB\Voicemeeter\MacroButtons.exe" (
start "" "C:\Program Files (x86)\VB\Voicemeeter\MacroButtons.exe"
echo Macro Buttons started.
goto :done
)
echo Macro Buttons executable not found in standard locations.
:done
echo Done!
timeout /t 2 /nobreak >nul"
A problem I don't know if it can be fixed any further4 is that because I have a smart TV, every week it seems like in hindsight, it would reset my connections so it would pretend to forget that the desktop is connected to it with an AVR between and that I want audio routed to the AVR and not the TV, because it seems whether I have ARC on the port being used on the TV or AVR or not, it still seems to do it. Don't know what the deal is, but this would then cause the scaling of windows to get all discombobulated and everything which would give me a headache every time that happened, and so I enacted the trick my instructor at MTECH, Doug, told me, and didn't have the gut to try without his help at the time, which I then did maybe nine months ago I think, and it mostly fixed the problem. In BIOS UEFI I set the monitor output to the TV to be forced or always on, I posted about this at the time for sure so it's covered there, but people told me this is a TV update but it was once a week, not once a month, what does Samsung need to update its TVs once a week for? IDK, maybe I am misremembering and it was once a month, but it feels like it was more frequent than that. And forced output stopped the entire discombobulation thing, but now the TV just switches audio and changes the size of windows and VLC player so it's like you're using it with a 4k TV without it being adapted to 4k, and the interface is the same size but all the characters and stuff are microscopic. A reboot fixes that but that is also not terribly common.
The most frequent thing is the window size thing with this somehow knocking VoiceMeeter out of whack, which is where the VoiceMeeter and all audio settings script comes in. The only audio settings problem this doesn't fix is that my Bluetooth headphones, even though they only connect to the AVR, pretend like they don't connect to the AVR. I used to be able to turn them off and back on and they would reconnect, but that doesn't happen anymore, too easy and fast. So I must reconnect them in AVR settings about once or twice a week, which even if annoying, only takes thirty seconds to fix.
This has been Truncat3d 00000000111100010100110______________end of line
No comments:
Post a Comment