Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Creating Windows Shortcuts has stopped working
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: Creating Windows Shortcuts has stopped working (Read 1120 times)
0 Members and 1 Guest are viewing this topic.
BazzaCAD
Guest
Creating Windows Shortcuts has stopped working
«
on:
September 14, 2018, 06:21:12 PM »
I've used the code below to create Windows Shortcuts to network folders for years, but for some reason over the last few days it has shopped working for everyone in the office.
All I can think of is a Windows Update has broke something.
Anyone have any ideas?
Code - Auto/Visual Lisp:
[Select]
(
defun
CreateShortcut
(
Name favFldr Path
/
)
(
if
(
=
wshLibImport
nil
)
(
progn
(
vlax-import-type-library
:tlb-filename
(
strcat
(
dos_specialdir
37
)
"wshom.ocx"
)
;_ "c:\\windows\\system32\\wshom.ocx"
:methods-prefix
"wshm-"
:properties-prefix
"wshp-"
:constants-prefix
"wshk-"
)
(
setq
wshLibImport T
)
)
)
(
setq
wshShell
(
vlax-create-object
"WScript.Shell"
)
)
(
setq
shrtObj
(
wshm
-
CreateShortcut wshShell
(
strcat
favFldr
"
\\
"
Name
".lnk"
)
)
)
(
vlax-put-property
shrtObj 'IconLocation
(
strcat
*
MasterServerPath
*
"startup
\\
Icons
\\
Acad.ico"
)
)
(
vlax-put-property
shrtObj 'TargetPath Path
)
(
vlax-invoke-method
shrtObj 'Save
)
)
The .lnk file is created, but when you double click on it, nothing happens. If I call the .lnk file from the command line, I get "The data is invalid" message box & "Access is denied" at the command line...
«
Last Edit: September 14, 2018, 06:24:33 PM by BazzaCAD
»
Logged
cmwade77
Swamp Rat
Posts: 1443
Re: Creating Windows Shortcuts has stopped working
«
Reply #1 on:
September 14, 2018, 07:04:04 PM »
The access denied would indicate that it is a security/permissions issue that is preventing you from saving to that location. My suggestion is to check with your IT department to see if they changed something recently.
Logged
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Creating Windows Shortcuts has stopped working