Flush flush holiday file update script
I believe you will encounter a lot of repetitive work when doing the operation and maintenance of flush system, such as holiday files. It is very troublesome to update them manually. You can make the following powershell script downholiday.ps1 to update automatically:
# define parameters, and each server modifies it as needed.
$SavePath='c:\ ths\'
SaveIni= "20181231-20190101-20190210-20190405-20190407 / 20190501-20190503 / 20190607-20190609 / 20190913-20190915 / 20191001-20191007;"
$NetFile=' https://download.cfzq.com/sj/holiday.ini'
# kill all send
Taskkill / im hexinvss.exe / f
Taskkill / im shex.exe / f
Taskkill / im shhk.exe / f
Taskkill / im shszcalc.exe / f
Taskkill / im options.exe / f
Taskkill / im stb.exe / f
Start-Sleep-s 3
# flush dos interface sends holiday update script
$SaveFile1=$SavePath+'hexinvss_binary\ conf\ holiday.ini'
$SaveFile2=$SavePath+'hexinvss_szhq\ conf\ holiday.ini'
$SaveFile3=$SavePath+'hexinvss_szwt\ conf\ holiday.ini'
$SaveFile4=$SavePath+'hexinvss_skhq\ conf\ holiday.ini'
$SaveFile5=$SavePath+'hexinvss_skwt\ conf\ holiday.ini'
$SaveFile6=$SavePath+'shex_hq\ conf\ holiday.ini'
$SaveFile7=$SavePath+'shex_wt\ conf\ holiday.ini'
$SaveFile8=$SavePath+'hgt\ shhk\ conf\ holiday.ini'
$SaveFile9=$SavePath+'shszcalc\ conf\ holiday.ini'
$SaveFile10=$SavePath+'Options\ Options.ini'
$SaveFile11=$SavePath+'stb_hq\ conf\ holiday.ini'
$SaveFile12=$SavePath+'stb_wt\ conf\ holiday.ini'
Get-ExecutionPolicy
$ConfirmPreference = 'None'
Set-ExecutionPolicy UnRestricted
$client = new-object System.Net.WebClient
$client.DownloadFile ($NetFile,$SaveFile1)
$client.DownloadFile ($NetFile,$SaveFile2)
$client.DownloadFile ($NetFile,$SaveFile3)
$client.DownloadFile ($NetFile,$SaveFile4)
$client.DownloadFile ($NetFile,$SaveFile5)
$client.DownloadFile ($NetFile,$SaveFile6)
$client.DownloadFile ($NetFile,$SaveFile7)
$client.DownloadFile ($NetFile,$SaveFile8)
$client.DownloadFile ($NetFile,$SaveFile9)
$client.DownloadFile ($NetFile,$SaveFile11)
$client.DownloadFile ($NetFile,$SaveFile12)
# Shanghai individual stock option update, close the program first
# load winapi
$ini = Add-Type-memberDefinition @ "
[DllImport ("Kernel32")]
Public static extern long WritePrivateProfileString (
String section
String key
String val
String filePath)
[DllImport ("Kernel32")]
Public static extern int GetPrivateProfileString (
String section
String key
String def
StringBuilder retVal
Int size
String filePath)
"@-passthru-name MyPrivateProfileString-UsingNamespace System.Text
# define configuration
$section= "Options"
$filePath=$SaveFile10
$key= "MarketCloseHoliday"
$val=$SaveIni
$retVal=New-Object System.Text.StringBuilder (200)
# generate or modify configuration files
$null=$ini::WritePrivateProfileString ($section,$key,$val,$filePath)
# View configuration file
$null=$ini::GetPrivateProfileString ($section,$key, "", $retVal,200,$filePath)
Write-Host $key "=" $retVal.tostring ()
# start all sends
$SavePath2=$SavePath+'hexinvss_binary\ bin\'
$SavePath3=$SavePath+'hexinvss_szhq\ bin\'
$SavePath4=$SavePath+'hexinvss_szwt\ bin\'
$SavePath5=$SavePath+'hexinvss_skhq\ bin\'
$SavePath6=$SavePath+'hexinvss_skwt\ bin\'
$SavePath7=$SavePath+'shex_hq\ bin\'
$SavePath7=$SavePath+'shex_wt\ bin\'
$SavePath8=$SavePath+'hgt\ shhk\ bin\'
$SavePath9=$SavePath+'shszcalc\ bin\'
$SavePath20=$SavePath+'Options\'
$SavePath21=$SavePath+'stb_hq\ bin\'
$SavePath22=$SavePath+'stb_wt\ bin\'
$SaveExe1=$SavePath+'hexinvss_binary\ bin\ hexinvss.exe'
$SaveExe2=$SavePath+'hexinvss_szhq\ bin\ hexinvss.exe'
$SaveExe3=$SavePath+'hexinvss_szwt\ bin\ hexinvss.exe'
$SaveExe4=$SavePath+'hexinvss_skhq\ bin\ hexinvss.exe'
$SaveExe5=$SavePath+'hexinvss_skwt\ bin\ hexinvss.exe'
$SaveExe6=$SavePath+'shex_hq\ bin\ shex.exe'
$SaveExe7=$SavePath+'shex_wt\ bin\ shex.exe'
$SaveExe8=$SavePath+'hgt\ shhk\ bin\ shhk.exe'
$SaveExe9=$SavePath+'shszcalc\ bin\ shszcalc.exe'
$SaveExe10=$SavePath+'Options\ Options.exe'
$SaveExe11=$SavePath+'stb_hq\ bin\ stb.exe'
$SaveExe12=$SavePath+'stb_wt\ bin\ stb.exe'
Start-Sleep-s 1
Cd $SavePath2
Start $SaveExe1
Start-Sleep-s 1
Cd $SavePath3
Start $SaveExe2
Start-Sleep-s 1
Cd $SavePath4
Start $SaveExe3
Start-Sleep-s 1
Cd $SavePath5
Start $SaveExe4
Start-Sleep-s 1
Cd $SavePath6
Start $SaveExe5
Start-Sleep-s 1
Cd $SavePath7
Start $SaveExe6
Start-Sleep-s 1
Cd $SavePath7
Start $SaveExe7
Start-Sleep-s 1
Cd $SavePath8
Start $SaveExe8
Start-Sleep-s 1
Cd $SavePath9
Start $SaveExe9
Start-Sleep-s 1
Cd $SavePath20
Start $SaveExe10
Start-Sleep-s 1
Cd $SavePath21
Start $SaveExe11
Start-Sleep-s 1
Cd $SavePath22
Start $SaveExe12