Batch - Converting variable to uppercase

前端 未结 8 1713
一向
一向 2020-12-02 01:39

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. C

8条回答
  •  -上瘾入骨i
    2020-12-02 02:12

    I used 2 files, in the batch I called an external js and in the bat I assign the response to an internal var:

    Bat:

    @echo off
    for /f %%i in ('cscript //nologo //E:jscript jsfile.js %1') do set VAR=%%i
    echo %Var%
    

    Js (jsfile.js in same directory):

    WScript.echo(WSH.Arguments(0).toUpperCase())
    

提交回复
热议问题