Input in a Batch file

Posted on 2004-07-30
Last Modified: 2012-06-21
Hi everybody
how can i give input in a batch file??
Question by:lightin_star

Accepted Solution

rohanpandya earned 50 total points
ID: 11676190
use %1 upto %9

 like i write content of batch file

  net share sharename = %1

 this is content of a.bat

 now when you run a.bat run as

     a "C:\rohan" so"c:\rohan" is input of batch file

Expert Comment

ID: 11677261
If you want interactive (not command line based) input and you run w2000 or newer you can use:

SET /P variable=[promptString]

That prompts the user for input and after pressing return the value is stored in the specified environment variable for later use.


Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Specific format 21 196
How  do I get an older program to run in Windows 10? 20 110
java  and programming certification ? 4 93
c++ reading data from file into two dimensional array 3 107
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question