领星动网编程开发之爆炸小宇宙

cnitblog.com/lxasp - - 有一种信念叫做编程
posts - 61, comments - 34, trackbacks - 0, articles - 0

置顶随笔

三五成群
三人行,必有我师
父母是儿女的启蒙老师
合家欢

posted @ 2023-10-24 13:05 lxasp 阅读(98) | 评论 (0)编辑 收藏

四面八方

posted @ 2023-10-24 11:50 lxasp 阅读(83) | 评论 (0)编辑 收藏

用批处理实现的CAB压缩解压程序。可兼容在XP/2003/Win7/Win10使用。

主要的两个文件:
2cabexp.cmd    --解压CAB压缩包文件到“我的文档”目录里,可支持拖放。在XP需要用本工具箱里的expand.exe和dpx.dll才可支持带目录结构的CAB文件解压。

2cabmkp.cmd   --将目录或文件生成CAB压缩包文件的批处理,可支持拖放。

两个批处理都支持方便的拖放功能。在资源管理器中将所需文件拖放到2cabexp.cmd或2cabmkp.cmd的文件名中即可方便解压或压缩。

CAB压缩解压批处理工具箱下载: cabmkmenu_202309122102.zip

实现CAB压缩的重要参数设置如下:
.OPTION EXPLICIT
.Set InfFileName=NUL
.Set RptFileName=NUL
.Set DestinationDir=
.Set CabinetName1="%~nx1.CAB"
.Set CabinetNameTemplate="%~nx1*.CAB"
.Set DiskDirectoryTemplate="%~dp1."
.Set UniqueFiles=OFF
.Set FolderSizeThreshold=2147483648
.Set MaxDiskSize=0
.Set Cabinet=on
.Set Compress=on
.Set CompressionType=LZX
.Set CompressionMemory=21

FolderSizeThreshold=2147483648  --这个就是单个CAB压缩包文件支持的最大容量(2GB)。

  

posted @ 2023-09-28 21:44 lxasp 阅读(132) | 评论 (0)编辑 收藏

Windows Executable Program that does nothing, source included.
Here is a Windows exe that does nothing without black cmd window or anything else.
There are three editions here: a normal size 2048 bytes, a small size 1536 bytes, a micro size 523 bytes.


什么都不做的空操作的无窗口的EXE可执行文件--可用于替换不要常驻进程的EXE

含有3个版本:常规版的EXE,2048字节;缩小版的EXE,1536字节;微小版的EXE,523字节。

【下载】Download: nop-exe-nul-exe-w32.zip

 

posted @ 2023-09-28 09:15 lxasp 阅读(130) | 评论 (0)编辑 收藏

VBScript实现运行“打开文件对话框”进行文件选择。(不创建临时文件

GetOpenFileName VBScript Solution Without Create Temporary File

Using 
HTA:APPLICATION with HtmlDlgHelper.openfiledlg(InitFilePath,'',FileTypeFilters,DialogCaption) 

Return The Result FileName From 
FileSystemObject(FSO) Stdout

Fully 
compatible: Windows XP / Windows Server 2003 (IE6--IE8)
Fully compatible: Windows 7 / Windows 8 / Windows 10 (IE8--IE11)
Fully compatible: Windows Vista (IE7) / Windows Server 2008 (IE7)

VBScript Code:
Function pickOpenFileName(caption,filters,initfn)
  caption=Trim(caption)
  Set w=CreateObject("WScript.Shell")::Set k=w.Environment("PROCESS")::k("c")=caption::k("f")=filters::k("n")=initfn
  Set e=w.Exec("%SystemRoot%\System32\mshta.exe ""about:<SCRIPT>p=new ActiveXObject('WScript.Shell').Environment('PROCESS');document.write('<TITLE>'+(p('c')||'\xA0')+'</TITLE>');try{moveTo(-9e4,0)}catch(E){}onload=function(){B=D.openfiledlg(p('n'),'',p('f'),p('c'));new ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1).WriteLine(B);close()}</SCRIPT><HTA:APPLICATION WINDOWSTATE=minimize /><OBJECT ID=D CLASSID=CLSID:3050F4E1-98B5-11CF-BB82-00AA00BDCE0B></OBJECT>""")
  pickOpenFileName=e.StdOut.ReadLine
End Function


Function takeOpenFileName(caption,filters,initfn,msght)
  caption=Trim(caption)
  Set w=CreateObject("WScript.Shell")::Set k=w.Environment("PROCESS")::k("c")=caption::k("f")=filters::k("n")=initfn::k("m")=msght
  Set e=w.Exec("%SystemRoot%\System32\mshta.exe ""about:<HTA:APPLICATION BORDER=none SHOWINTASKBAR=no INNERBORDER=no SCROLL=no /><BODY BGCOLOR=#DDEEFF TEXT=#336699><H1 ALIGN=RIGHT><SCRIPT>p=new ActiveXObject('WScript.Shell').Environment('PROCESS');document.write(p('m'))</SCRIPT></H1><OBJECT ID=D CLASSID=CLSID:3050F4E1-98B5-11CF-BB82-00AA00BDCE0B></OBJECT><SCRIPT>onload=function(){B=D.openfiledlg(p('n'),'',p('f'),p('c'));new ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1).WriteLine(B);close()}</SCRIPT>""")
  takeOpenFileName=e.StdOut.ReadLine
End Function


Sub maybeSplashScreen()
  Set w=CreateObject("WScript.Shell")
  v=w.RegRead("HKLM\SOFTWARE\Microsoft\Internet Explorer\Version")
  If CInt(Left(v,2))>7 Then Exit Sub
  v=w.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentVersion")
  If CInt(Left(v,2))>5 Then
    Set e=w.Exec("%SystemRoot%\System32\mshta.exe ""about:<HTA:APPLICATION BORDER=none SHOWINTASKBAR=no INNERBORDER=no SCROLL=no /><STYLE>body{margin:0}table{border-collapse:collapse}table,td{border:5px solid #6F6}</STYLE><BODY BGCOLOR=#009900 TEXT=#FFFFFF><TABLE WIDTH=100% HEIGHT=100%><TR VALIGN=MIDDLE><TD ALIGN=CENTER><FONT SIZE=7>正在加载...<BR>Loading...</FONT></TD></TR></TABLE></BODY>""")
    WScript.Sleep 500
    e.Terminate
  End If
End Sub


maybeSplashScreen()

r=pickOpenFileName("","","")
If Len(r)>0 Then MsgBox r,64,"OpenFile"

r=pickOpenFileName("请选择数据文件","电子表格(*.xls)|*.xls|所有文件(*.*)|*.*|","")
If Len(r)>0 Then MsgBox r,64,"OpenFile"


r=takeOpenFileName("","","","欢迎使用<BR>实用软件")
If Len(r)>0 Then MsgBox r,64,"OpenFile"

r=takeOpenFileName("请选择数据文件","电子表格(*.xls)|*.xls|所有文件(*.*)|*.*|","","欢迎使用<BR>实用软件<BR>版本:202308")
If Len(r)>0 Then MsgBox r,64,"OpenFile"

 

posted @ 2023-08-29 15:22 lxasp 阅读(175) | 评论 (0)编辑 收藏