CTC 发表于 2015-12-24 11:45:01

如何用LSP创建桌面快捷方式

如何用LSP创建程序的桌面快捷方式
如QQ,路径:D:\Program Files\QQ\qq.exe
给个例子,谢谢

陨落 发表于 2015-12-24 13:00:36

调用Wscript.shell即可

429014673 发表于 2015-12-24 23:48:16

过来坐看哪位大师的程序学习下

spp_wall 发表于 2015-12-25 10:45:08

不知道在那可以用到

CTC 发表于 2015-12-25 16:02:02

请求大师们写一个,谢谢

zzyong00 发表于 2015-12-26 11:59:59

这是用来编写病毒或流氓软件的吗?

zzyong00 发表于 2015-12-26 12:59:11

(defun mShellLnk
               (LnkName        FilePath      /
                  WshShell        WScript              oShellLink
                  colSpeFolders        strDesktop
               )
;BY zzyong00 2015-12-26
(vl-load-com)

(setq WshShell (vlax-create-object "WScript.Shell"))
(setq colSpeFolders (vlax-get-property WshShell "SpecialFolders"))

(setq        strDesktop
       (vlax-invoke-method colSpeFolders "Item" "Desktop")
)
(Setq        oShellLink
       (vlax-invoke-method
           WshShell
           "CreateShortcut"
           (strcat strDesktop "\\" LnkName ".LNK")
       )
)
(vlax-put-property oShellLink "targetPath" FilePath)
(vlax-put-property oShellLink "WindowStyle" 1)
(vlax-put-property
    oShellLink
    "IconLocation"
    (strcat FilePath ",0")
)
(vlax-invoke-method oShellLink "Save")
(vlax-release-object oShellLink)
(vlax-release-object WshShell)


)

(defun c:cl ()
(mShellLnk "calc" "c:\\windows\\system32\\calc.exe")
)

CTC 发表于 2015-12-26 14:05:15

zzyong00 发表于 2015-12-26 12:59 static/image/common/back.gif


桌面的快捷方式,好像没有图标,帮忙看看,谢谢

zzyong00 发表于 2015-12-26 14:15:45

(vlax-put-property
    oShellLink
    "IconLocation"
    (strcat FilePath ",0")
)
用exe文件的默认图标啊

CTC 发表于 2015-12-26 14:25:13

zzyong00 发表于 2015-12-26 14:15 static/image/common/back.gif
(vlax-put-property
    oShellLink
    "IconLocation"


我也不知怎么回事,就是没出来呢
页: [1] 2
查看完整版本: 如何用LSP创建桌面快捷方式