Operating Systems :: DOS :: dos get input |
|||
| By: Bernard |
Date: 21/11/2005 09:32:54 |
Points: 20 | Status: Answered Quality : Excellent |
| how to get input in DOS ? | |||
| By: VGR | Date: 21/11/2005 09:52:01 | Type : Answer |
|
| Yo there are classical answers to this classical problem. In the times of NT4 and before, when you had either the NT 32bits "kernel" or the true DOS operating system, you had to use add-ons or external programs built for this (Turbo-Pascal, C, whatever) and play with batches-calling-batches-returnvalue-branch etc One example of those marvelous add-ons is "dos4nt", a 209 KB application doing marvelous things : [] d:\dos4nt>? Where the interesting parts are INPUT, INKEY, TEE etc etc Examples of "solutions" available when NOT using add-ons are to be found there an other ugly one is : (dtech10) this is because Win2K has NO LONGER the CHOICE.EXE (former CHOICE.COM) of MSDOS 6+ any more. @echo off set /p Input= if /i "%Input%"=="y" (goto Proceed) exit /b :Proceed echo Proceed or this if /i not "%Input%"=="y" (exit /b) rem Here if Input=y/Y echo Proceed Nowadays, starting with Win2K (NT5.0) there are built-in solutions but they may involve uglier things like "windows scriptiong" (VBS, dangerous and unsecure) : echo wscript.quit wscript.stdin.readline> ~userin.vbs echo Please enter a number cscript.exe //NoLogo //B ~userin.vbs echo You entered %errorlevel% del ~userin.vbs I also read that this could work in most Zindoze flavours (MSDOS6+) except Win2K : choice Do you want to proceed? if errorlevel 2 quit rem hereafter the rest of your batch commands Finally, there is kind of a nice summary on this page have fun ;-) |
|||
|
Do register to be able to answer |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








