Open file location with users input in bat file

Hello eveyone.

this more than likely an easy one for you, but i am a novice on dos.

What i want to for a bat file to stay on a users desktop, that points to on part of our file structure, but when they click on it, it pops up with a question asking for a number, then when they press enter it asks for another number. Then once these have been entered it opens windows explorer in that location.


start \\server\folder1\folder2\number1\number2\

I have done this in office and everywhere else we need, but i can not get a value to be entered.

Any help please.

Who is Participating?
QlemoConnect With a Mentor Batchelor and DeveloperCommented:
to prompt for user input, use
set /P var=prompt.

In your case:

@echo off
set /P num1=first number?
set /P num2=second number?
start explorer /e,/r=\\server\folder1\folder2\%num1%\%num2%

BakersvilleAuthor Commented:
Worked a treat.  Thank you very much
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.