修改文件读写属性
我有自己写了一个文件Autoload.lsp,有时候会莫名被杀毒软件把文件属性修改成只读,是否有办法用写段代码把这个改成可以读写,谢谢!(defun SetRO (/ afile fso ofile ro)
(cond
((and (setq aFile (getfiled "" "" "" 4))
(setq fso (vlax-create-object "Scripting.FilesystemObject"))
(setq oFile (vlax-invoke fso 'GetFile aFile))
)
(vlax-put-property oFile 'Attributes (setq ro (- 1 (logand 1 (vlax-get-property oFile 'Attributes)))))
(princ (strcat "File set to " (nth ro '("Read-write" "Read-only"))))
(vlax-release-object oFile)
(vlax-release-object fso)
)
)
(princ)
) 1291500406 发表于 2019-11-3 11:46
(defun SetRO (/ afile fso ofile ro)
(cond
((and (setq aFile (getfiled "" "" "" 4))
您的办法试验成功,感谢!:handshake 我也需要这个 Thanks for sharing ^^
页:
[1]