Page 1 of 1

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

Posted: 15 Feb 2023 08:24
by Gizibo
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

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

Posted: 19 Feb 2023 17:20
by Sponge Belly
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

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

Posted: 20 Feb 2023 02:17
by Gizibo
Thankyou SB :-)