1. ,
:
set variable="value with spaces"
"value with spaces"
, , , variable
.
:
set "variable=value with spaces"
value with spaces
- variable
.
. 'echo% var%' 'set var = text' ?
2. , FOR
for /f "delims=" %%a in ('findstr /b "URL=" "%~1"') do set URL="%%a"
echo. %URL% | FIND /I "URL=">Nul || (set URL=""&goto chrome)
FOR, .
:
@echo off
set "URL="
for /F "delims=" %%a in ('%SystemRoot%\System32\findstr.exe /b "URL=" "%~1" 2^>nul') do set "URL=%%a"
if "%URL%"=="" goto Chrome
rem Remove URL= from string value.
set "URL=%URL:~4%"
echo URL found: %URL%
goto :EOF
:Chrome
echo No URL found.
URL=
, , URL
- .
3.
, GUI Unicode, Windows-1252.
OEM- 850 .
, , , .
, , , chcp - mode - , .
chcp .
, , , .
, .
4. FINDSTR
findstr . findstr , .
:
@echo off
for /F "usebackq tokens=1* delims==" %%a in ("%~1") do (
if /I "%%a"=="URL" (
set "URL=%%b"
goto FoundURL
)
)
echo No URL found.
goto :EOF
:FoundURL
echo URL found: %URL%
*.url findstr.
for /?
.
/F
. , . usebackq
, , .
:
URL=https://stackoverflow.com/
, delims==
.
Wanted - , , , , , 1 . tokens=1*
. , , 1, a
, - 2, b
.
, URL
, , . 2, URL, URL
, , .
, , *.url, URL=
, . goto :EOF
(EOF - - , ).
URL- .
,
D:\4all\reisen\istanbul\verkehr\fähren\Bosp_eminönü_2h_14h30_12tl_SehirHatlari.url
Windows , .
:
, - , .bat .exe?
.
"%1"
, .
Windows 3 :
, 8.3 . 8.3 8 / 3 . Windows, (.com .exe) 16- .
, ANSI, 1 . Windows, 32- 64- Unicode. Unicode system locale , Unicode. , Unicode, Windows.
, .. 2 , Unicode .
ANSI char C/++ Windows, Unicode wchar_t. C/++ Windows
"%L"
"%1"
HKEY_CLASSES_ROOT
Windows, Windows . , , C/++, DJGPP, 16- , , , ANSI- - .
: , , Windows - , .
, bat to exe 64- , Unicode. Unicode ANSI, , , , . , Unicode ANSI , 100% .