Computing.Net > Forums > Disk Operating System > Batch file with user input

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch file with user input

Reply to Message Icon

Name: TorturedBrain
Date: October 29, 2009 at 04:12:33 Pacific
OS: Windows XP
Subcategory: Configurations
Comment:

hi
i need help configuring batch file that asks the user to input a number 1-1000 and than perform a specific command the number of times that the user chose.



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: October 29, 2009 at 05:51:22 Pacific
Reply:

For DOS or XP?


=====================================
Helping others achieve escape felicity

M2


0

Response Number 2
Name: TorturedBrain
Date: October 29, 2009 at 07:04:18 Pacific
Reply:

its on windows XP


0

Response Number 3
Name: Mechanix2Go
Date: October 29, 2009 at 07:20:34 Pacific
Reply:

@echo off & setLocal EnableDELAYedExpansion

set /p N=how many ?

for /L %%a in (1 1 !N!) do (
echo do %%a
)


=====================================
Helping others achieve escape felicity

M2


0

Response Number 4
Name: TorturedBrain
Date: October 29, 2009 at 08:16:36 Pacific
Reply:

hi.
thank you for your response,
i have ran this:
@echo off & setLocal EnableDELAYedExpansion

set /p N=how many ?
ping x.x.x.x
for /L %%a in (1 1 !N!) do (
echo do %%a
)
it seems that it runs ping command only once and at the end i see:
do 1
do 2
do 3..10


0

Response Number 5
Name: TorturedBrain
Date: October 29, 2009 at 08:26:00 Pacific
Reply:

sorry. i moved the command to the end of the loop and it works!
thank you very much:)


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon





Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Batch file with user input

Batch copy with user input. www.computing.net/answers/dos/batch-copy-with-user-input/13211.html

Interactive batch files w/user input www.computing.net/answers/dos/interactive-batch-files-wuser-input/3274.html

batch file with www.computing.net/answers/dos/batch-file-with-/14234.html