Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for usrin.bat

(view source code of usrin.bat as plain text)

  1. @ECHO OFF
  2. :: Obtaining user input in Windows NT
  3. :: with the use of the LABEL command
  4. :: posted August 20,1999
  5. :: Author: Walter Zackery
  6. ::
  7. :: Adapted by Rob van der Woude
  8. :: (no longer uses a temporary file;
  9. :: redirection of label command's
  10. :: standard error prevents label command's
  11. :: own prompt to be displayed on screen)
  12.  
  13. CLS
  14. ECHO.
  15. FOR /F "tokens=5* delims= " %%A IN ('VOL C: ^| FIND "drive C"') DO SET OLDLABEL=%%B
  16. ECHO Enter some input string, containing no more than 32 characters:
  17. FOR /F "TOKENS=*" %%? IN ('LABEL C: 2^>NUL') DO SET INPUT=%%?
  18. SET INPUT
  19. LABEL C: %OLDLABEL%
  20.  

page last modified: 2024-02-26; loaded in 0.0194 seconds