本帖最后由 1291500406 于 2020-11-18 15:43 编辑
(command "start" "shell:::{3080F90D-D7AD-11D9-BD98-0000947B0257}")
方法2 shell (command "shell"(strcat "start " "shell:::{3080F90D-D7AD-11D9-BD98-0000947B0257}")) (command "shell" "start c:/")
外部软件 微软公司提供了两个应用 explorer rundll32 ~
(startapp "explorer shell:::{3080F90D-D7AD-11D9-BD98-0000947B0257}") (startapp "explorer c:/")
(startapp "rundll32 url.dll,FileProtocolHandler shell:::{3080F90D-D7AD-11D9-BD98-0000947B0257}") (startapp "rundll32 url.dll,FileProtocolHandler c:/")
ActiveX方法最多 数不清 以下是部分举例
(vlax-invoke(vlax-create-object"{13709620-c279-11ce-a49e-444553540000}")"ToggleDesktop" )
(vlax-invoke(vlax-create-object"{13709620-c279-11ce-a49e-444553540000}")"open" "shell:::{3080F90D-D7AD-11D9-BD98-0000947B0257}")
(vlax-invoke(vlax-create-object"{13709620-c279-11ce-a49e-444553540000}")"open" "c:\\")
(vlax-invoke(vlax-create-object"{72c24dd5-d70a-438b-8a42-98424b88afb8}")"run" "shell:::{3080F90D-D7AD-11D9-BD98-0000947B0257}" )
(vlax-invoke(vlax-create-object"{72c24dd5-d70a-438b-8a42-98424b88afb8}")"run" "c:/") (vlax-invoke(vlax-create-object"{13709620-c279-11ce-a49e-444553540000}")"ControlPanelItem""shell:::{3080F90D-D7AD-11D9-BD98-0000947B0257}" )
(vlax-invoke(vlax-create-object"{13709620-c279-11ce-a49e-444553540000}")"ControlPanelItem""c:/" )
方法9 SpecialFolders
(set 'bbActiveX(vlax-create-object"{72c24dd5-d70a-438b-8a42-98424b88afb8}"))
(vlax-invoke bbActiveX "exec"(strcat "explorer.exe "(vla-item(vlax-get bbActiveX "SpecialFolders" ) "desktop")))
(vlax-invoke bbActiveX "exec"(strcat "explorer.exe "(vla-item(vlax-get bbActiveX "SpecialFolders" ) "c:/")))
方法10 ShellExecute
(vlax-invoke(vlax-create-object"{13709620-c279-11ce-a49e-444553540000}")"ShellExecute""rundll32" "url.dll,FileProtocolHandler shell:::{3080F90D-D7AD-11D9-BD98-0000947B0257}")
(vlax-invoke(vlax-create-object"{13709620-c279-11ce-a49e-444553540000}")"ShellExecute""rundll32" "url.dll,FileProtocolHandler c:/")
方法一:
(Close(open "D:\\bbtxt0.txt""w"))
方法二:
(vlax-invoke-Method(Vlax-Invoke-Method(vlax-create-object "{0d43fe01-f093-11cf-8940-00a0c9054228}")"CreateTextFile" "D:\\bbtxt1.txt" nil 0)"Close")
方法三:
(vlax-invoke(vlax-invoke(vlax-create-object "{0d43fe01-f093-11cf-8940-00a0c9054228}")"OpenTextFile" "D:\\bbtxt2.txt" nil 8 -1)"Close")
方法四:
(Setq obj (Vlax-Get-Or-Create-Object "{00000566-0000-0010-8000-00aa006d2ea4}" ))
(vlax-invoke obj "open")
(Vlax-Invoke-Method obj "SaveToFile" "D:\\bbtxt3.txt" 2)
(Vlax-Invoke obj "Close" ) (command "shell" "dir> D:\\BBBBB.TXT") (command "shell" "echo > D:\\BBBBbbB.TXT")
繁体简体互转
(defun bb-fantitostr (lst mod / bb-str W D lst1 )
(vl-load-com)
(setq lst1 nil)
(foreach str lst
(setq W(vlax-create-object"{000209FF-0000-0000-C000-000000000046}"))
(setq D(vlax-invoke-method(vla-get-Documents W) 'add))
(vlax-invoke-method (vla-get-Selection W)"TypeText" str )
(vlax-invoke-method(vlax-invoke-method D 'Range) ' TCSCConverter mod -1 -1)
(setq lst1 (cons (vl-string-right-trim "\r" (vlax-get(vlax-invoke-method D 'Range) ' Text) ) lst1 ))
(vlax-put D ' Saved -1)
(vlax-invoke-method D ' Close)
(vlax-release-object D)
(vlax-release-object W)
)
(reverse lst1)
) (bb-fantitostr '("下面" "大学" "朋友" "老师")0)
还有很多...
|