- (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")
- )
|