Challenge:
- the string path is likely to be on a remote computer (I'm testing backup path returned for some remote SQL servers)
- you cannot try to create the path locally (after all it may be a drive letter not available locally)
- use the minimum lines of code (I can foresee a for loop with : and \ as delimiters)
That's a question... for dummies like me. On Linux it'd be very easy with a simple regex validation.
Have any of you guys done this before?
Would a simple pipe findstr /R do the trick?
thanks
How to validate a string is a valid path
Moderator: DosItHelp
Re: How to validate a string is a valid path
don't bother and archive this.
and test ERRORLEVEL, done.
Code: Select all
echo %REMOTE_PATH% | findstr /I /R "[c-z]:\\[a-z]"