千家信息网

同花顺节假日文件更新脚本

发表于:2026-11-02 作者:千家信息网编辑
千家信息网最后更新 2026年11月02日,相信大家在做同花顺系统运维时候碰到不少重复劳动,如节假日文件,手动更新非常麻烦,可做成如下powershell脚本downholiday.ps1实现自动更新:#定义参数,各服务器根据需要修改此处。$S
千家信息网最后更新 2026年11月02日同花顺节假日文件更新脚本

相信大家在做同花顺系统运维时候碰到不少重复劳动,如节假日文件,手动更新非常麻烦,可做成如下powershell脚本downholiday.ps1实现自动更新:
#定义参数,各服务器根据需要修改此处。
$SavePath='c:\ths\'
$SaveIni="20181231;20190101;20190204-20190210;20190405-20190407;20190501-20190503;20190607-20190609;20190913-20190915;20191001-20191007;"
$NetFile='https://download.cfzq.com/sj/holiday.ini'

#kill所有发送
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

#同花顺dos界面发送节假日更新脚本
$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)

#上海个股期权更新,要先关闭程序
#加载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

#定义配置
$section="Options"
$filePath=$SaveFile10
$key="MarketCloseHoliday"
$val=$SaveIni
$retVal=New-Object System.Text.StringBuilder(200)

#生成或修改配置文件
$null=$ini::WritePrivateProfileString($section,$key,$val,$filePath)

#查看配置文件
$null=$ini::GetPrivateProfileString($section,$key,"",$retVal,200,$filePath)
Write-Host $key "=" $retVal.tostring()

#启动所有发送
$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

更新 文件 配置 同花 脚本 个股 参数 手动 服务器 期权 界面 程序 系统 麻烦 维时 上海 劳动 服务 生成 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 互联网科技公司排名 互联网科技公司的优势 没上市的科技互联网公司 亿策互联网科技 未来的互联网科技 科技互联网创业计划书 哈尔滨秒房互联网科技有限公司 互联网公司会议桌创意科技软装饰 温州喔噻互联网科技有限公司 团飞科技与伯堂互联网服务平台 互联网公司科技股 花神(南京)互联网科技有限公司 开一家科技互联网公司需要多少钱 河南住房之家互联网科技 世界互联网领先科技成果获奖 山东有哪些互联网科技公司 国大互联网教育科技有限公司薪资 陕西九四连强互联网科技有限公司 第三届互联网大会安防黑科技 重庆科技产业互联网有哪些 花魁咖啡 中国互联网科技工作委员会毛军 欧洲十大科技互联网公司 成都互联网科技公司工作好不好 互联网公司黑科技创始人 中科明德北京互联网科技 无锡工业互联网科技有限公司 中国新注册互联网科技 互联网界的黑科技 深圳互联网科技园地址
0