home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / novell / 6665 < prev    next >
Encoding:
Internet Message Format  |  1992-08-20  |  1.9 KB

  1. Path: sparky!uunet!dtix!darwin.sura.net!wupost!wuvmd!c09615bt
  2. From: C09615BT@WUVMD (Brad Thone)
  3. Newsgroups: comp.sys.novell
  4. Subject: Re: Login Script Variables > DOS Environmental Variables
  5. Message-ID: <92233.221855C09615BT@wuvmd.wustl.edu>
  6. Date: 21 Aug 92 04:19:18 GMT
  7. References: <4682@news.duke.edu>
  8. Organization: Washington University, St. Louis
  9. Lines: 45
  10. To:           NETNEWS@WUVMD
  11.  
  12. I have a tiny program called NETDRIVE.COM that a friend gave to me.
  13.  
  14. Type NETDRIVE and presto!  You are instantly logged to the first
  15. network drive (usually, but not always) F:.
  16.  
  17. Using a batch file, you could pretty easily set an environment variable
  18. to the first net drive.....
  19.  
  20. ------------- Begin FIRSTNET.BAT -----------------------
  21. @ECHO OFF
  22. REM Set env var FIRSTNET to first logical network drive
  23. F:LOGINNETDRIVE
  24. CD 
  25. COPY C:NETFILE1.TXT C:NETSETVAR.BAT
  26. CD >> SETVAR.BAT
  27. SETVAR
  28. --------------- End FIRSTNET.BAT --------------------------
  29. -------------- Begin FILE1.TXT ----------------------------
  30. @SET FIRSTNET=
  31. --------------- End FILE1.TXT ------------------------------
  32.  
  33. SPECIAL NOTE!  FILE1.TXT must NOT contain a carriage return!
  34. Creat FILE1.TXT by typing this exactly as I describe....
  35. At the DOS prompt:  type COPY CON FILE1.TXT  and hit <RETURN>
  36. At the cursor: type @SET FIRSTNET=  and hit <Ctrl-Z>
  37.     (note:  there is NO space after the equal sign)
  38. At the ^Z displayed:   hit <RETURN>
  39.  
  40. I would recommend making FILE1.TXT readonly then.
  41. (Of course, FILE1.TXT is a stupid name.  Rename it....)
  42.  
  43. One small drawback to this is that if your first network drive
  44. is F:  then FIRSTNET=F:     (with the backslash)
  45. Maybe that matters, maybe not.
  46. A recent issue of PCWorld published a batch file that would let you
  47. do string manipulation using DOS environment variables and DOS commands....
  48.  
  49. Let me know if you want the NETDRIVE.COM....
  50. I'll UUEncode it.
  51.  
  52. Note:  The above batch files have never been tried by me.  I just made
  53. them up.  No reason why they won't work though.
  54.  
  55. Bon chance!
  56. Brad Thone
  57.