creating a batch file to pause for user input to open a specific folder in windows...

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Gizibo
Posts: 2
Joined: 15 Feb 2023 08:16

creating a batch file to pause for user input to open a specific folder in windows...

#1 Post by Gizibo » 15 Feb 2023 08:24

Hi Group

is it possible to create a batch file to pause for user input to open a specific folder in windows...

what i would like to do is in windows double click on a batch file on the desktop so that when it runs it will go to the specified drive but then pause asking for some input so the user can enter the directory they would like and then when enter is hit the required folder will open in windows for use.

so say drive = C: and it is full of lots of folders. say folder1, folder2, folder 3 etc...
then you would run the batch file and a window will pop up in CMD as c: "enter folder name required" the user will then type in the folder name required say "folder25" then a window in windows will pop up with this folder open.

is this possible?
G

Sponge Belly
Posts: 221
Joined: 01 Oct 2012 13:32
Location: Ireland
Contact:

Re: creating a batch file to pause for user input to open a specific folder in windows...

#2 Post by Sponge Belly » 19 Feb 2023 17:20

Hi Gizibo! :)

Please read this post (#32) by Aacini.

Once you have the folder chosen by the user stored in a variable (eg, %folderName%), you can open a File Explorer window at that location by doing the following:

Code: Select all

start "" "%folderName%"
HTH! 8)

- SB


Post Reply