Author Topic: username via lisp???  (Read 7642 times)

0 Members and 1 Guest are viewing this topic.

Ron Heigh

  • Guest
username via lisp???
« on: July 01, 2004, 01:33:25 PM »
Is there any way to get the username of the computer using LISP?

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
username via lisp???
« Reply #1 on: July 01, 2004, 01:36:20 PM »
perhaps (getenv "username")
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Slim©

  • Needs a day job
  • Posts: 6566
  • The Dude Abides...
username via lisp???
« Reply #2 on: July 01, 2004, 01:38:29 PM »
Or maybe (getvar "loginname")
I drink beer and I know things....

JohnK

  • Administrator
  • Seagull
  • Posts: 10646
username via lisp???
« Reply #3 on: July 01, 2004, 01:48:26 PM »
Or even (getstring "\nWhat's your name dummy? ")
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Ron Heigh

  • Guest
username via lisp???
« Reply #4 on: July 01, 2004, 01:51:18 PM »
Thanks Lance.
That's what I was looking for.

Slim©

  • Needs a day job
  • Posts: 6566
  • The Dude Abides...
username via lisp???
« Reply #5 on: July 01, 2004, 01:52:59 PM »
It's what we're here for, enjoy.
I drink beer and I know things....

JohnK

  • Administrator
  • Seagull
  • Posts: 10646
username via lisp???
« Reply #6 on: July 01, 2004, 01:53:08 PM »
*Bahhp?!* Dude, what's wrong with mine?!
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Slim©

  • Needs a day job
  • Posts: 6566
  • The Dude Abides...
username via lisp???
« Reply #7 on: July 01, 2004, 01:54:07 PM »
I like it, Se7en. Don't know about the others tho.  :twisted:
I drink beer and I know things....

JohnK

  • Administrator
  • Seagull
  • Posts: 10646
username via lisp???
« Reply #8 on: July 01, 2004, 01:59:50 PM »
Thanx Lance. Since you like it so much i wrote you a little app you can use in your programs.

Code: [Select]
(defun test ()
  (if
    (not
      (eq
        (getenv "username") (getstring "\nWhat's your name dummy? ")))
    (progn (alert "Liar!!") (test)))
  (princ)
  )
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Anonymous

  • Guest
username via lisp???
« Reply #9 on: July 01, 2004, 06:46:31 PM »
Quote from: Se7en
Or even (getstring "\nWhat's your name dummy? ")


LOL

Slim©

  • Needs a day job
  • Posts: 6566
  • The Dude Abides...
username via lisp???
« Reply #10 on: July 01, 2004, 07:03:26 PM »
Thanks alot Se7en.
I drink beer and I know things....

Ron Heigh

  • Guest
username via lisp???
« Reply #11 on: July 02, 2004, 11:01:11 AM »
(getenv "username") = nil

This isn't set on my computer.  How do I use it?[/code]

nivuahc

  • Guest
username via lisp???
« Reply #12 on: July 02, 2004, 11:18:54 AM »
Try

(getvar "loginname")

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
username via lisp???
« Reply #13 on: July 02, 2004, 11:25:16 AM »
Maybe this;
Code: [Select]

(if (not (getenv "username"))
  (setenv "username" "name")
)
TheSwamp.org  (serving the CAD community since 2003)

LUCAS

  • Newt
  • Posts: 32
username via lisp???
« Reply #14 on: July 05, 2004, 12:42:27 AM »
Code: [Select]

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