BaSs_HaXoR

wifi auto on-connect script #2/2 (for windows wifi)

Nov 18th, 2025 (edited)
1,938
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.16 KB | None | 0 0
  1. :: --- (bat) wifi auto on-connect script (for windows wifi) #2/2 ---
  2.  
  3. :: -- (python) Script #1/2 here: https://pastebin.com/wcJaa963 --
  4. :: -- create a shortcut of this file. Once created, right click on it
  5.  
  6. :: -- Now "Create Shortcut". Cut/copy the shortcut, paste in C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
  7. :: -- You can use this if you only want it on current user: --
  8. :: -- C:\Users\Username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup --
  9.  
  10. :: -- Finished. Restart computer/logout current user. This script will run on ALL USERS on PC. --
  11.  
  12.  
  13. @echo off
  14. :: --- Check for admin ---
  15. net session >nul 2>&1
  16. if %errorlevel% neq 0 (
  17.     echo Requesting administrative privileges...
  18.     powershell -Command "Start-Process '%~f0' -Verb RunAs"
  19.     exit /b
  20. )
  21.  
  22. :: --- Activate Conda environment ---
  23. CALL C:\ProgramData\Anaconda3\Scripts\activate.bat yolo_env2
  24.  
  25. :: --- Navigate to script directory ---
  26. cd /d C:\Users\{PUT YOUR USERNAME OF YOUR USER}\Desktop\{WHATEVER LOCATION YOU WANT}
  27.  
  28. :: --- Run Python script visibly ---
  29. python {PUT YOUR PYTHON SCRIPT#1/2 NAME HERE}.py
  30.  
  31. :: --- Keep window open after script exits ---
  32. pause
  33.  
Advertisement
Add Comment
Please, Sign In to add comment