Skip to content

Instantly share code, notes, and snippets.

@amitkhare
Created February 23, 2021 13:28
Show Gist options
  • Save amitkhare/4ccf61b418d166299ef8bb6173fbdbb9 to your computer and use it in GitHub Desktop.
Save amitkhare/4ccf61b418d166299ef8bb6173fbdbb9 to your computer and use it in GitHub Desktop.
Opens ftp folder if PC is connected through mobile hotspot and there is an FTP server running on it at port 2221
@echo off
netsh wlan show interfaces | Findstr /c:"Signal" && set "CStatus=true" || set "CStatus=false"
for /f "tokens=2,3 delims={,}" %%a in ('"WMIC NICConfig where IPEnabled="True" get DefaultIPGateway /value | find "I" "') do set "location=%%a"
set location=%location:"=%
echo opening explorer at %location%
IF /i "%CStatus%"=="true" explorer.exe ftp://%location%:2221
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment