TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Ron Heigh on July 01, 2004, 01:33:25 PM
-
Is there any way to get the username of the computer using LISP?
-
perhaps (getenv "username")
-
Or maybe (getvar "loginname")
-
Or even (getstring "\nWhat's your name dummy? ")
-
Thanks Lance.
That's what I was looking for.
-
It's what we're here for, enjoy.
-
*Bahhp?!* Dude, what's wrong with mine?!
-
I like it, Se7en. Don't know about the others tho. :twisted:
-
Thanx Lance. Since you like it so much i wrote you a little app you can use in your programs.
(defun test ()
(if
(not
(eq
(getenv "username") (getstring "\nWhat's your name dummy? ")))
(progn (alert "Liar!!") (test)))
(princ)
)
-
Or even (getstring "\nWhat's your name dummy? ")
LOL
-
Thanks alot Se7en.
-
(getenv "username") = nil
This isn't set on my computer. How do I use it?[/code]
-
Try
(getvar "loginname")
-
Maybe this;
(if (not (getenv "username"))
(setenv "username" "name")
)
-
(defun C:TT (/ WS)
(vl-load-com)
(setq WS (vlax-create-object "wscript.network"))
(alert
(strcat "USERNAME= "
(vlax-get-property WS 'USERNAME)
"\n\nUSERDOMAIN= "
(vlax-get-property WS 'USERDOMAIN)
"\n\nCOMPUTERNAME= "
(vlax-get-property WS 'COMPUTERNAME)
)
)
(vlax-release-object WS)
(princ)
)