@ Echo off
Color 0a
Mode con lines = 20 Cols = 49
Title FTP personal password change V1.0 code by jl_li
::****************************
: * This segment is the information displayed by the program running *
::****************************
Echo.
Echo. Description
Echo.
Echo this program only applies to changing the company intranet data backup FTP personal login password
Echo.
Echo _______________ copyright does not exist ☆flipped version is free ______________
Echo.
: Start
:: **************************************** *****
: * Set the Server IP address and output it to the FTP file *
: * If you want to change the IP address to the following code *
: * Set IP = *
: * Set/p ip = enter the Server IP Address :*
: * Echo open % IP %> FTP *
:: **************************************** *****
Echo open 192.168.148.18> FTP
:: **************************************** ********
: * Enter the user name, original password, and new password, and change the password *
: * Send and change the password command and exit the FTP command to the FTP file *
:: **************************************** ********
Set username =
Set/P username = enter the User Name:
Echo % username %> FTP
Set oldpassword =
Set/P oldpassword = enter the original password:
Echo % oldpassword %> FTP
Set newpassword =
Set/P newpassword = enter the new password:
Echo quote site pswd % oldpassword % newpassword %> FTP
Echo bye> FTP
Echo.
Modifying echo password... please wait!
Echo.
:: **************************************** **********************
: * This section uses command line parameters to call the parameters in the FTP file to change the FTP password *
: * And export the result to the B .txt file *
:: **************************************** **********************
@ Echo off
Ftp.exe-S: ftp> B .txt
:: **************************************** *****************
: * This section determines whether the password is successfully changed based on the output result and jumps accordingly *
:: **************************************** *****************
For/F "Skip = 6 tokens = *" % I in (B .txt) Do (
Echo % I | findstr "Proceed."> NUL & goto end
Echo % I | findstr "530"> NUL & goto fail1
Echo % I | findstr "connected."> NUL & goto fail2
Echo % I | findstr "later."> NUL & goto fail3
)
:: **************************************** ******
: * The prompt message displayed when the username or password entered is incorrect *
:: **************************************** ******
: Fail1
CLS
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo *************************************** *********
Echo * the user name or password entered is incorrect. Please try again *
Echo *************************************** *********
Echo.
Echo.
Del FTP
Del B .txt
Goto start
:: **************************************** *************************
: * This section is the prompt message when an error occurs when connecting to the server. If the address is set to manually entered above *
: * You need to change the prompt to: Check whether the connection to the server is normal or whether the entered address is correct *
:: **************************************** *************************
: Fail2
CLS
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo *************************************** *********
Echo * Unable to connect to the server. Check whether the connection to the server is normal *
Echo *************************************** *********
Echo.
Echo.
Del FTP
Del B .txt
Goto start
:: **************************************** ******
: * This section indicates the prompt message when the maximum number of logon users is reached *
:: **************************************** ******
: Fail3
CLS
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo *************************************** *********
Echo * the maximum number of server logins has been reached. Please try again later *
Echo *************************************** *********
Echo.
Echo.
Del FTP
Del B .txt
Goto start
::**********************************
: * This is the prompt message when the password is successfully changed *
::**********************************
: End
CLS
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo *************************************** *********
Echo * the password is successfully modified. Remember your new password and press any key to exit *
Echo **
Echo **
Echo * If the password is forgotten, send an email to me :*
Echo *************************************** *********
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Echo.
Del FTP
Del B .txt
Pause
Exit