Want RealTimeSync to only run on regular wifi, not Hotspot data

Get help for specific problems
Posts: 1
Joined: 10 Oct 2024

mattchoochoo

I posed this question to ChatGPT. This was the response. Does this sound like it would work?

-----
To avoid hardcoding SSIDs and have RealTimeSync run only on regular WiFi networks, here’s an approach using a network type check. This will detect whether you’re on a WiFi or a mobile hotspot connection based on the network adapter properties.

Here’s how to set it up:

1. Batch Script to Detect Network Type:
This script checks the current network profile for a WiFi connection versus a mobile or hotspot connection, without specifying SSIDs.

@echo off
netsh wlan show interfaces | findstr /C:"State" > nul
if %errorlevel% equ 0 (
    echo "Connected to a regular WiFi network."
    start "" "C:\path\to\FreeFileSync\RealTimeSync.exe" "C:\path\to\sync.ffs_real"
) else (
    echo "Not on a regular WiFi network. Sync aborted."
)

• Explanation:
• netsh wlan show interfaces outputs details about WiFi connections. If a WiFi connection is detected, the script starts RealTimeSync.
• If no WiFi connection is found, it assumes the connection might be a hotspot and skips the sync.

2. Integrate with RealTimeSync:
• In RealTimeSync, go to Tools > Settings.
• Set this batch script as the Command to run before RealTimeSync begins syncing.

This way, RealTimeSync will only start syncing when connected to a regular WiFi network, avoiding any hotspot connections without needing specific SSID names.