本帖最后由 pcl_test 于 2015-4-18 17:12 编辑
- @echo off
- ::设置背景音乐
- set "music=D:\鸟之诗.mp3"
- (echo,set wmp = CreateObject("WMPlayer.ocx"^)
- echo,wmp.url = "%music%"
- echo,do until wmp.playState = 1
- echo,wsh.sleep 100
- echo,loop)>"%temp%\mtmp.vbs"
- start "" "%temp%\mtmp.vbs"
- :begin
- cls
- echo ————————————
- echo 》》》请选择语言《《《
- echo 1、简体中文 2、繁体中文
- echo ————————————
- echo.
- set /p language=[序号+回车]:
- echo.
- if /i "%language%" == "1" goto zh_cn
- if /i "%language%" == "2" goto zh_tw
- cls
- echo,“%language%”不是有效值,请重新输入!
- ping 0 -n 3 >nul
- goto begin
- :zh_cn
- if not exist "%programfiles%\test\Cache\" md "%programfiles%\test\Cache\"
- >"%programfiles%\test\Cache\cache.ini" echo,zh_cn
- >>"%programfiles%\test\Cache\cache.ini" echo,你选择的是简体中文
- ::获取文件大小
- for %%i in ("%programfiles%\test\Cache\cache.ini") do echo,cache.ini文件大小为【%%~zi】字节
- ::读取文件第一行
- set /p first=<"%programfiles%\test\Cache\cache.ini"
- echo,这是cache.ini文件的第一行内容【%first%】
- ::逐行读取文件
- for /f "delims=" %%a in ('type "%programfiles%\test\Cache\cache.ini"') do echo,逐行读取cache.ini的内容【%%a】
- echo ————————————
- echo,》》按任意键退出……
- pause >nul
- taskkill /f /im wscript.exe >nul 2>nul
- exit
- :zh_tw
- echo,未设置
- echo ————————————
- echo,》》按任意键退出……
- pause >nul
- taskkill /f /im wscript.exe >nul 2>nul
- exit
复制代码
|