|
|
![]() |
| Thread Tools | Search this Thread |
#1
| |||
| |||
User inputs in Batch (.bat) files I wanted to know how we can create a batch file with user inputs in it. How does they work? I have seen my senior working on it, creating batch files with user inputs and then making installation of OS easier by which the bootable floppy disk would ask for the user input before the installation, then creates an answer file of the details inputted and then starts the installation, I want to try such a task and similar other things. Can I learn it easily? |
#2
| |||
| |||
Re: User inputs in Batch (.bat) files Sometimes we need some user interaction in our batch files. We may need to know to which directory a file is to be copied, for example. Or which drive needs to be formated. There are many ways to achieve this user interaction. The most basic form of user interaction, of course, is the PAUSE command, which halts the batch file until the user presses "any key" (apart from Ctrl, Alt, Shift, CapsLock, NumLock or ScrollLock). Maybe not really sophisticated, but it works and is always available, in all DOS, Windows and OS/2 versions. |
#3
| |||
| |||
Re: User inputs in Batch (.bat) files If you want the user to choose one of three options, you make a simple menu, then make three batch files whose names correspond to the menu choices: Code: @echo off echo Please pick a number and hit Enter: echo 1 - John echo 2 - Ron echo 3 - Shawn |
#4
| |||
| |||
Re: User inputs in Batch (.bat) files Batch is usually used for computing without user interaction. All data are in files|DB|cmd line. Here is an example: Create the following script and call it clientdir.cmd: Code: C: CD \Clients SET /P cname=[Enter Last Name] MKDIR %cname% CD %cname% MKDIR subdir1 MKDIR subdir2 |
![]() |
|
Tags: bat, batch file |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Batch file : How to create folders with user input | BLaaR | Software Development | 1 | 10-05-2012 06:53 PM |
Need batch file to delete user files in Windows XP | mcamp32 | Windows XP Support | 1 | 26-05-2011 10:54 PM |
display all the odd numbers between the range the user inputs | MaryJ | Software Development | 1 | 22-11-2010 05:13 PM |
calculate the sum of all the even numbers between the range the user inputs | MaryJ | Software Development | 1 | 20-11-2010 07:07 PM |
How to add local domain user via batch file | Imtiyaz | Networking & Security | 3 | 18-05-2009 09:51 PM |