:StartsWith text string -- Tests if a text starts with a given string :: -- [IN] text - text to be searched :: -- [IN] string - string to be tested for SETLOCAL set "txt=%~1" set "str=%~2" if defined str call set "s=%str%%%txt:*%str%=%%" if /i "%txt%" NEQ "%s%" set=2>NUL EXIT /b