Windows Batch fetch Update software

Source: Internet
Author: User
Tags goto ini mkdir ssh

001

@ECHO off

002

:: Luohongjiang

003

:: qq:123769752

004

Setlocal enabledelayedexpansion

005

Mode con cols=50 lines=17

006

: Test

007

Set Var=[luohongjiang]

008

set/a FF=100/30

009

FOR/L%%i in (1,1,30) do (

010

set/a ss=%%i*!ff!

011

Set var=!var!^>

012

Cls

013

set/p var=!var!! ss!%%

014

Ping 127.0.0.1-n 1 >nul

015

)

016

017

: Init

018

Cls

019

for/f "eol=# tokens=1* delims=^="%%i in (. Cfg.ini) Do (

020

Title%%i%%j

021

If%%i EQU Updatewyip (

022

Set Wyipaddress=%%j

023

PING!wyipaddress! -N 1-w 300ms >nul

024

IF! errorlevel! NEQ 0 (

025

msg%username%/w "Software network settings are problematic, please check the settings. "

12W

Notepad Cfg.ini

12V

Exit

028

)

22{

)

030

If%%i EQU UPDATEWGIP (

031

Set Wgipaddress=%%j

032

PING!wgipaddress! -N 1-w 300ms >nul

033

IF! errorlevel! NEQ 0 (

034

msg%username%/w "Body soft network settings are problematic, please check the settings. "

035

Notepad Cfg.ini

036

Exit

037

)

038

)

039

If%%i EQU wyversion set Wyver=%%j

040

If%%i EQU wgversion set Wgver=%%j

041

If%%i EQU Wypath set Ypath=%%j

042

If%%i EQU Wgpath set Gpath=%%j

043

If%%i EQU sshclientxml set Sshxmlpath=%%j

24v

)

045

046

set/a mm=%random%%%9

047

Color%mm%f

048

if exist!wyipaddress!! Ypath!*.exe (

049

msg%username%/w "Software has a new version, please post after testing. "

050

The set alart= software has a new version, please release it after testing. ) Else (

051

The set alart= does not have a version available temporarily.

052

)

053

054

if exist!wgipaddress!! Gpath!*.exe (

055

msg%username%/w "Body Soft has a new version, please post after testing. "

056

The set alart= has a new version, please post after testing. ) Else (

057

The set alart= does not have a version available temporarily.

058

)

059

060

061

: Menu

062

Title version Publisher

063

Cls

064

echo Hint:%alart%

065

Echo╔┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉╗

066

ECHO│[1] Software Release │

067

Echo││

068

ECHO│[2] Fusion version release │

069

Echo││

070

ECHO│[3] Software Trial Version │

071

Echo││

072

Echo│[4] Body Soft trial Version │

073

Echo││

074

ECHO│[5] Add SSH mapped IP and port │

075

Echo╚┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉╝

076

Echo.

077

Echo.

078

Echo.

079

Set var=0

080

set/p var= Please enter the corresponding number for the corresponding function [1/2/3/4/5/z]:

081

082

If%var% EQU 1 (goto:wyupdate)

083

If%var% EQU 2 (goto:wgupdate)

084

If%var% EQU 3 (goto:wydowntest)

085

If%var% EQU 4 (goto:wgdowntest)

086

If%var% EQU 5 (GOTO:MODSSH)

087

If%var% EQU z (start Notepad%sshxmlpath% && exit) Else (Goto:init)

088

089

::::,:::::;:: £ º;:;;:; Wyupdate:::::::::::::-:-:.:

090

: Wyupdate

091

Xcopy/j/d/i. I-signal_setupsetup.exe!wyipaddress!! ypath!

092

Pause

093

Goto:menu

094

::::,:::::;:: £ º;:;;:; Wgupdate:::::::::::::-:-:.:

095

: Wgupdate

096

Xcopy/j/d/i. I-signal_setupsetup.exe!wyipaddress!! gpath!

097

Pause

098

Goto:menu

099

::::,:::::;:: £ º;:;;:; Wydowntest:::::::::::::-:-:.:

100

: Wydowntest

101

Title!wyipaddress!

102

if exist!wyipaddress!! Ypath!*.exe (

103

del/q I-signal_setup

104

mkdir I-signal_setup

105

xcopy/j/d/i!wyipaddress!! Ypath!*.exe. I-signal_setup

106

Move. I-signal_setup*.exe. I-signal_setupsetup.exe

107

del/q!wyipaddress!! Ypath!*.exe

108

Exit

109

) Else (

110

Set alart= There is no new version, you just wait.

111

Goto:menu

112

)

113

::::,:::::;:: £ º;:;;:; Wgdowntest:::::::::::::-:-:.:

114

: Wgdowntest

115

Title!wyipaddress!

116

if exist!wyipaddress!! Gpath!*.exe (

117

del/q I-signal_setup

118

mkdir I-signal_setup

119

xcopy/j/d/i!wyipaddress!! Gpath!*.exe. I-signal_setup

120

Move. I-signal_setup*.exe. I-signal_setupsetup.exe

121

del/q!wyipaddress!! Gpath!*.exe

122

Exit

123

) Else (

124

Set alart= There is no new version, you just wait.

125

Goto:menu

126

)

127

128

::::,:::::;:: £ º;:;;:; Modify to::::::::::::::::, ()

129

: Modssh

130

Copy%sshxmlpath%%sshxmlpath%.bak

131

Cls

132

Set ip=%ip%

133

Set port=%port%

134

set/p ip= Please enter the added ip[%ip%]:

135

set/p port= Please enter the added port [%port%]:

136

137

for/f "delims="%%i in (%sshxmlpath%) do (

138

echo%%i "Test.xml

139

For%%j in (%%i) do (

140

if%%j = = ^

141

echo ^ ^ "Test.xml

142

Echo added successfully

143

Pause)

144

145

)

146

)

147

Copy Test.xml%sshxmlpath% >nul

148

del/q Test.xml

149

150

Goto:menu

Configuration file

#此文件为配置文件, please change it in the following format.

####################### #软体 ###################

#配置软体更新服务器的ip Address

updatewyip=127.0.0.1

#配置软体下载试用软件的目录

Wypath=package

#配置软体上传软件的目录

Wyupath=uppackage

#配置软体发布软件的版本号

wyversion=v1.0

####################### #体软 ####################

#配置体软更新服务器的ip Address

updatewgip=127.0.0.1

#配置体软上传软件的目录

Wgupath=uppackage

#配置体软下载试用软件的目录

Wgpath=package

#配置体软发布软件的版本号

wgversion=v1.0

####################### #ssh #####################

Path to #配置ssh代理程序配置文件SSHProxyClient. xml

Sshclientxml=. Sshproxyclient.xml

Related Article

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.