There are 2 ways to read settings.

by (Login burger2227)
R

'You can use ENVIRON$ to find out a lot of things, like the PC username:

CLS : s = 1
COLOR 11: LOCATE 2, 27: PRINT "DOS Environment Variables": PRINT
DO WHILE ENVIRON$(s) <> ""
COLOR 14: PRINT s; ENVIRON$(s)
s = s + 1
IF s MOD 20 = 0 THEN
LOCATE 24, 25: PRINT "Press Any Key to continue!";
DO: SLEEP: LOOP UNTIL INKEY$ <> ""
CLS
COLOR 11: LOCATE 2, 27: PRINT "DOS Environment Variables": PRINT
END IF
LOOP
COLOR 11: LOCATE 24, 2: PRINT "End of list! Press Any Key!"
DO: SLEEP: LOOP UNTIL INKEY$ <> ""

'You can use the value string names listed to pick which setting to return.

CLS
Prompt$ = ENVIRON$("PROMPT")
User$ = ENVIRON$("USERNAME")
Puter$ = ENVIRON$("COMPUTERNAME")
OpSys$ = ENVIRON$("OS")
Blaster$ = ENVIRON$("BLASTER")
COLOR 14: LOCATE 15, 25: PRINT "DOS Prompt = "; Prompt$
LOCATE 16, 25: PRINT " User Name = "; User$
LOCATE 17, 25: PRINT " Computer = "; Puter$
LOCATE 18, 25: PRINT "OS Version = "; OpSys$
LOCATE 19, 25: PRINT " Blaster = "; Blaster$


'I don't know what VISTA or 7 will return, but Win 9x return little.

'Ted



    
This message has been edited by burger2227 on Jul 1, 2010 6:13 PM

Posted on Jul 1, 2010, 5:10 PM

Respond to this message   

Return to Index


Response TitleAuthor and Date
Or you could use interrupt 21 like normal peopleBen on Jul 1
 Thanks Ben ... yikes though ... on Jul 1
 * That has NOTHING to do with our discussion moron! on Jul 1
  * Sorry, seemed relevant to me! on Jul 1
  *Clippy, stop calling people names. It's not very nice. You should apologize.Solitaire on Jul 2
   *Hear hear. Ben should be more observant of netiquette but that doesn't make him a moron on Jul 2
    to be honest, I think it was Ben's inferring I was "abnormaL" that prompted the post on Jul 2
     * You meant pot stirring. At this forum, we refer to the container, not the contents. on Jul 3
      * "pot stirring" ... haha, did you just make that up? on Jul 3