batch file - Left-string, variable matching in a DOS command? -



batch file - Left-string, variable matching in a DOS command? -

is possible string pattern match in dos? instance want following:

if "%username" == "abc*" (echo 1)

i know asterisk doesn't work here , can't find alternative. have ideas?

try

if "%username:~0,3%" == "abc" (echo 1)

this substring %username 3 characters beginning

good luck

string batch-file pattern-matching dos

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -