Visa ett inlägg
Oläst 2013-03-19, 00:14 #2
Conny Westh Conny Westh är inte uppkopplad
Klarade millennium-buggen
 
Reg.datum: Aug 2005
Inlägg: 5 166
Conny Westh Conny Westh är inte uppkopplad
Klarade millennium-buggen
 
Reg.datum: Aug 2005
Inlägg: 5 166
Här är ett exempel på hur du kan lösa problemet:

Kod:
@echo off
::
: SeekText.bat - Test if pattern in string
: Param1 - the pattern
: Param2 - the string to check
::

echo.%2 | findstr /C:"%1" 1>nul

if errorlevel 1 (
  echo. Returnerade 1 - pattern not found
  goto inget
) ELSE (
  echo. Returnerade 0 - found pattern
  goto hittat
)
goto end

:inget
echo Hittade INGET intressant...
goto end

:hittat
echo Hittade vad vi ville ha!
goto end

:end
echo Done.

Så här kan du använda batfilen:
Kod:
SeekText "test.se" "test.se/test/hej/pelle"

Senast redigerad av Conny Westh den 2013-03-19 klockan 00:19
Conny Westh är inte uppkopplad   Svara med citatSvara med citat