I want to be able to choose a folder path based on the range the userID is in I do believe it is the if statement as I tested just putting a static path as the variable and it works when echoed.
@echo off
:home
SET /P user=Please enter user ID:
echo Finding network folder..
if %user% GEQ 0001 if %user% LSS 1000 set /P npath=\\users\0001-0999\%user%
if %user% GEQ 1000 if %user% LSS 2000 set /P npath=\\users\1000-1999\%user%
If %user% GEQ 2000 if %user% LSS 3000 set /P npath=\\users\2000-2999\%user%
if %user% GEQ 3000 if %user% LSS 4000 set /P npath=\\users\3000-3999\%user%
if %user% GEQ 4000 if %user% LSS 5000 set /P npath=\\users\4000-4999\%user%
echo file path is %npath%
net use H:%npath%
PAUSE
goto :home
I have echoed out the two variables after declaring(npath and user in order to test if I am setting them improperly, they echo out fine
I also tried the script suggested here Batch Variable Value Check Range?
all user ID are 4-digits whether 0010 or 3987 I need this to decide which folder path based on the range and then map it based on that.
Aucun commentaire:
Enregistrer un commentaire