I need some help finishing this up. Its going to be a shortcut to opening a specific folder in a very large directory structure.
An example folder location would be \\SERVER923\data\10900-10999\10956-somename-anothername
I want the user to open the batch file, enter 5 digits, hit enter and have it open explorer to that folder that starts with those 5 digits
I have this complete except for the "-somename-anothername" part. Basically I dont care what this part of the folder name is, all I care about is the 5 digit number. I have tried to add a wildcard character after the 5 digits as seen below but it does not work... any assistance would be helpful!

Code: Select all
@echo off
setlocal enableextensions enabledelayedexpansion
set /p UserInput=Enter a number:
set /a Test=UserInput
if !Test! EQU 0 (
if !UserInput! EQU 0 (
echo !UserInput!
) else (
echo Not a number
)
) else (
echo !UserInput!
set start=!UserInput:~0,3!
set end=!UserInput:~0,3!
%SystemRoot%\explorer.exe "\\SERVER923\data\!start!00-!end!99\!UserInput!-*"
)