BDMV.INFO

 Retrieve Password
 register now
Search
Hot: #
!show!: 23695|Reply: 0

[2014.04.05] Autoamtically Connect to the Internet by PPPoE at Win7 Operate System [Copy URL]

Rank: 9Rank: 9Rank: 9

Post time 2014-4-5 12:56:57 |Show all posts
The Best method is useing the bash script (bat) to do the auto connection.
A guy had already wrote a script to his blog. We can use this script to arrive our request.

Step1
Because of I want to remote login the server and I want to automically connect the internet, I install the teamviewer to replace with the RDP
I ignore the installation steps of teamviewer, but please remember the setting of automatically to execute the teamviewer when the the computer enter the os.


Step2
If you don't cancel the password protection, you can't automatically execute the startup script when you restart or power on the computer
So, after installing the teamviewer, disable the login password of remote computer, actually, that is dangerous, please consider your situation and make your choice.


Step3
Copy the below script to a new test document and change the extension name to bat like 'autopppoe.bat',  guys can consider the below picture to show and change the extension type of the file name in the win7/win server2008 os.
  1. @echo off      
  2. ECHO Checking connection, please wait...      
  3. PING -n 1 [url]www.google.com[/url]|find "回覆自" >NUL      
  4. IF NOT ERRORLEVEL 1 goto :SUCCESS      
  5. IF     ERRORLEVEL 1 goto :TRYAGAIN
  6. :TRYAGAIN      
  7. ECHO -------------------------------------------------------        
  8. ECHO -------------------------------------------------------      
  9. ECHO FAILURE!      
  10. ECHO Let me try a bit more, please wait...      
  11. @echo off      
  12. PING -n 3 [url]www.google.com[/url]|find "回覆自" >NUL      
  13. IF NOT ERRORLEVEL 1 goto :SUCCESS2      
  14. IF     ERRORLEVEL 1 goto :FAILURE
  15. :SUCCESS      
  16. netsh wlan start hostednetwork      
  17. ECHO -------------------------------------------------------      
  18. ECHO -------------------------------------------------------      
  19. ECHO You have an active Internet connection      
  20. :pause      
  21. goto END
  22. :SUCCESS2      
  23. netsh wlan start hostednetwork      
  24. ECHO -------------------------------------------------------      
  25. ECHO -------------------------------------------------------      
  26. ECHO You have an active internet connection but some packet loss was detected.      
  27. :pause      
  28. goto :END
  29. :FAILURE      
  30. ECHO -------------------------------------------------------      
  31. ECHO -------------------------------------------------------      
  32. ECHO You do not have an active Internet connection      
  33. ECHO Reconnecting.. Please Wait      
  34. ECHO -------------------------------------------------------   
  35. ECHO -------------------------------------------------------      
  36. @echo off      
  37. rasdial PPPoE_Connection_name  /DISCONNECT      
  38. rasdial PPPoE_Connection_name PPPoE_Account PPPoE_Password      
  39. ECHO Re-checking Connection, please wait...      
  40. PING -n 3 www.google.com|find "回覆自" >NUL      
  41. IF NOT ERRORLEVEL 1 goto :SUCCESS      
  42. IF     ERRORLEVEL 1 goto :FAILURE
  43. :FAILURE2      
  44. ECHO -------------------------------------------------------      
  45. ECHO -------------------------------------------------------      
  46. ECHO Reconnenction Failed.      
  47. ECHO Please try later.      
  48. :pause      
  49. goto :END
  50. :END
Copy the Code
Substituting  the PPPoE_Connection_namePPPoE_Account and PPPoE_Password to appiciate  as appropriate.

Step4
Cut the script to startup folder.


Then, remote restarting the os. If you find the signed in information auto show from teamviewer at the os right corner, it represent the auto connection script script indeed work fine.


--------reference--------
利用批次檔來完成 ADSL自動撥號 + 筆電變成無線AP http://mikelong9.blogspot.tw/2014/01/adsl-ap.html
You have to log in before you can reply Login | register now

Archiver|Cell Phone|BDMV.INFO

GMT+8, 2024-3-28 22:36 , Processed in 0.016124 second(s), 6 queries , Xcache On.

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

Top