• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

batch file ucase question

kefegg

Member
Hey guys,
DOS isn't a real programming-thing but I have a question about it and hoped this is the right place.

I want to make a simple batch that reads a .txt file to create folders by what is in that text.file (names of people or chassisnumbers of cars).
But, here comes the question, I want that the folder be created in uppercase text, even if the input is lowercase.

this is what I've got so far.

@ECHO OFF
TITLE create folders
:_start
CLS
SET /P _folder=which folder do you want to create:
IF NOT EXIST %_folder% goto :_notexist
ECHO this folder already exist.
SET /P _question=you want to so what is inside the folder? (Y/N)?
IF /I {%_question%}=={Y} (goto :_show)
IF /I {%_question%}=={N} (goto :_notshow)
:_show
CLS
TREE %_folder%
pause
:_notshow
CLS
ECHO.
ECHO 1. overwrite this folder
ECHO 2. create another folder
ECHO 3. end program
SET /P _mchoice=make your choice(1-3):
IF "%_mchoice%" == "" goto _notshow
IF "%_mchoice%" == "1" goto _notexist
IF "%_mchoice%" == "2" goto _start
IF "%_mchoice%" == "3" goto :eof
:_notexist
CLS
MKDIR %_folder%
FOR /f "tokens=1-7" %%G IN (text.txt) DO @MD %_folder%\%%G" "%%H"
"%%I" "%%J" "%%K" "%%L" "%%M

I found some things about converting low to uppercase but I cannot make things work.

Would appreciate some help but also would like that I still have to think things out (I don't want to be the lazy one 😀)

thanks in regard
 
I thought something like this might work. Listing the complete alphabet is not so bad to do but I wander if there might be a 'smaller' code to write.
Anyway I'm gonna try this one out.
If the output is good, it's good.

muchas gracias!
 
Back
Top