Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7711307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:20:31+00:00 2026-06-01T01:20:31+00:00

hello I am making web page searching program with windows batch file before searching

  • 0

hello I am making web page searching program with windows batch file

before searching it, I need to save html code to variable and regex.

I am on windows xp sp3

I wonder how can I send special character mixed string as function parameter

my code is here

cd curl-7.25

for /f "tokens=*" %%R IN ('curl.exe -G --max-redirs 3 http://www.google.com?') DO call:MyFunc %%R

pause

:MyFunc
echo %~1
goto:eof

the problem is on “call:MyFunc %%R”

the html code includes many ‘<‘ and ‘>’ (brackets)

and this interpreted as piping.

which I am trying to avoid.

any help would be appreciated

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T01:20:33+00:00Added an answer on June 1, 2026 at 1:20 am

    You can’t escape the content of %%R, as you receive it from curl.
    But you can handle it with delayed expansion.

    cd curl-7.25
    set "curlCmd=curl.exe -G --max-redirs 3 http://www.google.com?"
    
    setlocal DisableDelayedExpansion
    for /f "tokens=*" %%R IN ('!curlCmd!') DO (
      set "line=%%R"
      call :MyFunc line
    )
    pause
    exit /b
    
    :MyFunc
    setlocal EnableDelayedExpansion
    echo !%~1!
    rem ** Or you can use directly echo !line!
    endlocal
    exit /b
    

    I first disable delayed expansion, else you get problems with exclamation marks and/or carets.
    And then I call :MyFunc with the variable name not the content, as call would modify the content.

    And to access the content I enable the delayed expansion, as delayed expansion never modify or interfere with the content of a variable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello i am making a program that is supposed to copy a text file.
Hello I have the following code namespace ConsoleApplication2 { class Program { static void
Hello i want to know if i can download my app before making it
I'm experimenting with internationalization by making a Hello World program that uses properties files
hello I am very beginer of haskell I am making GUI program that open
Hello I am making a simple program which is taking input from user and
Hello guys i'm making a little app in which i need to enumerate all
hello im a bit confused here. lets say we are making a simple page
Hello I am making a double buffer in C# and I need to find
http://developer.android.com/resources/tutorials/views/hello-spinner.html I'm following this ^ tutorial on making a spinner but when I get

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.