Search This Blog

Loading...

Thursday, March 29, 2012

How do you prompt for user input in a CMD batch file?

In this example, var1 is the name of the variable which stores user input.

@echo off
set /p var1=Enter Info: %=%
echo %var1%
pause

If you found this information helpful, please consider linking to Eugene Computer Repair.

Donations are greatly appreciated.

Subscribe to: Posts (Atom)

Legal Notice

Alan Curtis and A1 Smart Computer Services provide programming examples and technical information for illustration only without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose.

Alan Curtis does not assume any legal liability or responsibility for the accuracy and/or completeness of the information provided. Alan Curtis will not be held liable for any direct or indirect loss or damage arising under this legal notice or in connection with the use of this website. Alan Curtis is not affiliated with Microsoft, Yahoo and Google. All trademarks and copyrighted material are the property of their respective owners.

The opinions expressed by Alan Curtis on this blog is based upon information he considers reliable but is not warranted for its completeness or accuracy and should not be relied upon as such. Alan Curtis' statements and opinions are subject to change without notice.

The entire contents of this blog has been copyrighted by Alan Curtis and A1 Smart Computer Services unless otherwise indicated. All rights are reserved by Alan Curtis and A1 Smart Computer Services and content may not be reproduced, downloaded, disseminated, published, or transferred in any form or by any means, except with the prior written permission of Alan Curtis and A1 Smart Computer Services.

For professional Eugene Computer Repair, contact A1 Smart Computer Services.