07-23-2023, 06:52 AM
How would I go about changing the **destl** variable to uppercase before it is used. I assume some sort of character swap, however I couldn't get it working. Code is as follows -
@echo off
echo.
set /P "destf=Enter First Name: "
set /P "destl=Enter Last Name: "
set "findest=Z:\ProjectIT\copy\%destl%, %destf%"
robocopy Z:\ProjectIT\copy\test "%findest%" /e /NFL /NDL /NJH /NJS
robocopy Z:\ProjectIT\copy\Construction "%findest%"\1-BLANK-%destl% /e /NFL /NDL /NJH /NJS"
echo Construction folder has been created for "%destl%"
echo.
pause
I have tried calling something like the following, but could not get it to work -
:Uppercase
set %~1=!%1:a=A!
set %~1=!%1:b=B!
set %~1=!%1:c=C!
set %~1=!%1:d=D!
set %~1=!%1:e=E!
set %~1=!%1:f=F!
set %~1=!%1:g=G!
set %~1=!%1:h=H!
set %~1=!%1:i=I!
set %~1=!%1:j=J!
set %~1=!%1:k=K!
set %~1=!%1:l=L!
set %~1=!%1:m=M!
set %~1=!%1:n=N!
set %~1=!%1:o=O!
set %~1=!%1:p=P!
set %~1=!%1:q=Q!
set %~1=!%1:r=R!
set %~1=!%1:s=S!
set %~1=!%1:t=T!
set %~1=!%1:u=U!
set %~1=!%1:v=V!
set %~1=!%1:w=W!
set %~1=!%1:x=X!
set %~1=!%1:y=Y!
set %~1=!%1:z=Z!
Sorry about the rough code - I'm quite new to this.
Regards,
Joshua
@echo off
echo.
set /P "destf=Enter First Name: "
set /P "destl=Enter Last Name: "
set "findest=Z:\ProjectIT\copy\%destl%, %destf%"
robocopy Z:\ProjectIT\copy\test "%findest%" /e /NFL /NDL /NJH /NJS
robocopy Z:\ProjectIT\copy\Construction "%findest%"\1-BLANK-%destl% /e /NFL /NDL /NJH /NJS"
echo Construction folder has been created for "%destl%"
echo.
pause
I have tried calling something like the following, but could not get it to work -
:Uppercase
set %~1=!%1:a=A!
set %~1=!%1:b=B!
set %~1=!%1:c=C!
set %~1=!%1:d=D!
set %~1=!%1:e=E!
set %~1=!%1:f=F!
set %~1=!%1:g=G!
set %~1=!%1:h=H!
set %~1=!%1:i=I!
set %~1=!%1:j=J!
set %~1=!%1:k=K!
set %~1=!%1:l=L!
set %~1=!%1:m=M!
set %~1=!%1:n=N!
set %~1=!%1:o=O!
set %~1=!%1:p=P!
set %~1=!%1:q=Q!
set %~1=!%1:r=R!
set %~1=!%1:s=S!
set %~1=!%1:t=T!
set %~1=!%1:u=U!
set %~1=!%1:v=V!
set %~1=!%1:w=W!
set %~1=!%1:x=X!
set %~1=!%1:y=Y!
set %~1=!%1:z=Z!
Sorry about the rough code - I'm quite new to this.
Regards,
Joshua