推广一下,3 楼转成 mshta 混编就是这样:- <!-- :
- @echo off&cls
- for /f "tokens=2 delims==" %%a in ('wmic path win32_operatingsystem get LocalDateTime /value') do set "t=%%a"
- set "y=%t:~0,4%"
- set "m=%t:~4,2%"
- if %m:~,1% equ 0 set "m=%m:~-1%"
- set d=%t:~6,2%
- if %d:~,1% equ 0 set "m=%d:~-1%"
- set "getdate=%y%/%m%/%d%"
- for /f "delims=" %%b in ('mshta "%~fs0"') do set "xlsdate=%%b"
- if "%getdate%" equ "%xlsdate%" (taskkill /f /im excel.exe © "D:\aa\542.xls" "E:\rb\") else (taskkill /f /im excel.exe)
- pause
- -->
- <script src=http://www.bathome.net/lib/diy/hide.js></script>
- <script src=http://www.bathome.net/lib/diy/WSH.js></script>
- <script language=vbscript>
- Dim oExcel,oWb,oSheet
- Set oExcel= CreateObject("Excel.Application")
- Set oWb = oExcel.Workbooks.Open("D:\aa\542.xls")
- Set oSheet = oWb.Sheets("Sheet1")
- Wscript.echo oSheet.Range("E2").Value
- </script>
复制代码 这样就不怎么破坏 bat 的格式了,代价是不能离线运行,若要脱网得运行一次 Libs.offline() 将脚本转为离线
话说我好像把批处理之家玩坏了,说好的批处理呢... |