Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Command Prompt Help


  • Please log in to reply

#1
mike760534211

mike760534211

    New Member

  • Member
  • Pip
  • 1 posts
I have a batch file that runs a command correctly. Is there a way I can add commands to it to prompt me for a number of how many times to run.

say I want to run in 25 times but the next time it needs to only run 10 times. can the batch files prompt me for that variable?
  • 0

Advertisements


#2
SleepyDude

SleepyDude

    Trusted Helper

  • Malware Removal
  • 4,988 posts
Hi Mike :welcome:

One way to do it:
@echo off
SETLOCAL ENABLEEXTENSIONS

set /P N= Repeat times?

for /L %%i IN (1,1,%N%) do (
  echo -- step %%i --
  echo Command1
  echo Command2
  echo ---
)

  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP