Batch-Programm finden Sie string in variable

Habe ich versucht zu finden, die Lösungen in vielen Orten, aber nicht finden konnte, spezifische Antwort.

Erstelle ich ein batch-Skript.
Folgendes ist mein code bisher

    @echo off
    SETLOCAL EnableDelayedExpansion
    cls
    for /f "delims=" %%a in ('rasdial EVDO cdma cdma') do set "ras=!ras! %%a"

    findstr /C:"%ras%" "already"

    if %errorlevel% == 0 
    (
        echo "it says he found the word already"
    )
    else
    (
        echo "it says he couldn't find the word already"
    )

AUSGABE :

    FINDSTR: Cannot open already
    The syntax of the command is incorrect.

Ich versuche zu finden, das Wort 'schon' in der variable 'ras',

Scheint das problem zu sein
findstr /C:"%ras%" "schon"

Versuchte ich mit
findstr "%ras%" "schon"
aber das funktioniert nicht besonders.

InformationsquelleAutor Sid1024 | 2014-11-15

Schreibe einen Kommentar