IP address Import and Export script

Source: Internet
Author: User

When you are on a business trip, you often need to modify the IP address information to access the Internet. However, after the organization, you need to change the original IP address back. This is inconvenient. So I wrote the following script to share it with you. In addition, please kindly advise:

The script is not complete yet: 1. Whether the file selector effect can be implemented in the script when the IP information is exported. The User specifies the storage path, and the user selects the path during the import.

2. Can I determine whether the export has been exported before, and then whether the user can continue to export the data? If yes, export the data again; otherwise, the script is terminated.

The script code is posted below. At the same time, we hope you can give me some advice on the above two questions. Thank you!

Script for exporting IP information:

@ Echo off
CLS
Echo.
Echo this script will automatically extract the IP address related to the local machine and save it to your disk.
Echo.
Echo ======================= author of The Script: nange! @ Version 2010/09/02 ========================
Echo.
ECHO is extracting the local IP address...
Netsh-C interface dump> D:/ipinfobackup.txt
Echo.
If exist D:/ipinfobackup.txt (
Echo IP address and other information exported successfully! For details, see D:/ipinfobackup.txt.
) Else echo IP extraction failed! Please try again later...
Echo.
Echo ================================= script execution is complete! Please follow any Jian end ===========================
Echo.
Pause
@ Echo on

Script for importing IP information:

@ Echo off
CLS
Echo.
Echo this script imports the specified IP address information to help you efficiently set the IP address and other related information.
Echo.
Echo ======================= author of The Script: nange! @ Version 2010/09/02 ========================
Echo.
ECHO is importing IP address information...
ECHO is setting IP address information. Please wait...
If exist D:/ipinfobackup.txt (
Netsh exec D:/ipinfobackup.txt
Echo IP address and other related information have been imported successfully.
The IP address specified by else ECHO does not exist. Run "export local IP. Bat" first "! Try again...
Echo.
Echo ================================= script execution is complete! Please follow any Jian end ===========================
Echo.
Pause
@ Echo on

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.