home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / msdos / programm / 8641 < prev    next >
Encoding:
Internet Message Format  |  1992-08-19  |  2.5 KB

  1. Path: sparky!uunet!charon.amdahl.com!pacbell.com!mips!sdd.hp.com!swrinde!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!cleveland.Freenet.Edu!bx304
  2. From: bx304@cleveland.Freenet.Edu (Jeff Epler)
  3. Newsgroups: comp.os.msdos.programmer
  4. Subject: Re: A batch programming contest for you
  5. Message-ID: <1992Aug20.005148.7275@usenet.ins.cwru.edu>
  6. Date: 20 Aug 92 00:51:48 GMT
  7. References: <1992Aug19.065119.10003@cs.ubc.ca> <1992Aug18.052017.3758@uwasa.fi>
  8. Sender: news@usenet.ins.cwru.edu
  9. Reply-To: bx304@cleveland.Freenet.Edu (Jeff Epler)
  10. Organization: Case Western Reserve University, Cleveland, OH (USA)
  11. Lines: 58
  12. Nntp-Posting-Host: slc5.ins.cwru.edu
  13.  
  14.  
  15. In a previous article, yogi@cs.ubc.ca (Yossi Gil) says:
  16.  
  17. >ts@uwasa.fi (Timo Salmi) writes:
  18. >
  19. >>As you might know I have a large collection of batch files and
  20. >>tricks garbo.uwasa.fi:/pc/ts/tsbat36.zip. I am always looking for
  21. >>useful new information for it.
  22. >
  23. >Well, I have this other discovery that I try to offer every year
  24. >or so, but it still remains unnoticed. I hope that you will add
  25. >this to your tips&tricks so that I will not have to pound on this
  26. >again in a year from now. 
  27. >
  28. >How to prevent ctrl-breaks during execution of autoexec.bat? 
  29. >------------------------------------------------------------
  30. >The "ctty nul" command is a well known trick, but it doesn't hold
  31. >if the user types in ^C quickly. One usually puts "@echo off" at the
  32. >beginning of the batch file. These leavs even more time to the
  33. >intruding user to break. 
  34. >
  35. >My trick is to create
  36. >    shell=command.com /p nul line in my config.sys file. This will
  37. >make command.com start with the nul device as its standard
  38. >input/output. It is undocumented, but worked in all of the many dos
  39. >versions I have tried it on.
  40. >
  41. >And yet another relatively unknwon features of COMMAND.COM. Did you
  42. >know that the following would work? Can you figure out what it will
  43. >do?
  44. >
  45. >    <NUL> con ver 
  46.  
  47. Same as ver <nul >con, or just ver since it takes no input.
  48. >
  49. >as well as
  50. >
  51. >    <CON> nul vol 
  52.  
  53. Does nothing:  Sends the volume label to nul.  Dos has never been too
  54. picky about where <, > redirections go..
  55. >
  56. >not mentioning
  57. >
  58. >    if not if == not shift else ; endif 
  59.  
  60. Shifts (I think else ; endif is ignored as an arguement to shift)
  61. because if is not the same as not.
  62. >
  63. >These may prove useful to encrypt your batch files. 
  64.  
  65. Confused me for a bit.
  66.  
  67. -- 
  68. |Jeff Epler               Additions Welcome           c(-8 ;-) >{8-) |
  69. | :) (=( =-] (-= Celebrating the variety of faces =-> :^) {-= |-) (: |
  70. | >X^P                                              Lincoln, Nebraska|
  71.