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 9146835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:50:29+00:00 2026-06-17T10:50:29+00:00

This is turning out to be way more difficult than I thought (and than

  • 0

This is turning out to be way more difficult than I thought (and than it probably should be).

I’ve tried Cygwin+curl, but that fails to run (Cygwin can never find curl.exe, but I did do a package check and it’s there).

I’ve tried curl for Windows, using the command prompt, and it works. But I have quite a few urls to check and doing them individually just isn’t time efficient. I can’t figure out how to tell curl, through cmd prompt, to use a file (since there’s no “xargs”) like mentioned here.

I’ve also tried using PowerShell, but that’s also being problematic. When I try to follow option 1 here

I get an error when I try running $xHTTP.open("GET",$url,$false):

Exception calling “open” with “3” argument(s): “Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))”

Also with PowerShell, I have absolutely no idea how to get it to use a file containing urls. My knowledge of PS is very very limited (as in non-existent).

What would be nice here would be to figure out how to get the command prompt/curl to use a file, but I can’t figure that out.

  • 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-17T10:50:30+00:00Added an answer on June 17, 2026 at 10:50 am

    There is a more direct way to do this with PowerShell V3:

    PS> Get-Content .\urls.txt
    http://www.cnn.com
    http://www.msn.com
    
    PS> Get-Content urls.txt | Foreach { Invoke-WebRequest -Uri $_ -Method HEAD }
    
    StatusCode        : 200
    StatusDescription : OK
    Content           :
    RawContent        : HTTP/1.1 200 OK
                        Vary: Accept-Encoding
                        Connection: Keep-Alive
                        Cache-Control: max-age=60, private
                        Content-Type: text/html
                        Date: Tue, 08 Jan 2013 20:21:46 GMT
                        Expires: Tue, 08 Jan 2013 20:22:46 GMT...
    Forms             : {}
    Headers           : {[Vary, Accept-Encoding], [Connection, Keep-Alive], [Cache-Control, max-age=60, private],
                        [Content-Type, text/html]...}
    ...
    

    To handle 404’s use a try/catch e.g.:

    PS> Get-Content urls.txt | 
            Foreach {try {Invoke-WebRequest -Uri $_ -Method HEAD} catch { "Oops - $_"}}
    

    To redirect to a file, this works for me:

    PS> Get-Content urls.txt | 
            Foreach {try {Invoke-WebRequest -Uri $_ -Method HEAD} catch { "Oops - $_"}} > 
            $home\Desktop\foo.txt
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is something I thought would be easier than it's turning out to be.
I thought this would be easy, but turning out to be hard. All I
There are similar questions to this out there, but they are either unanswered or
probably a straightforward to the trained eye but I have agonised over this for
Does anyone know where I can find a library of common but difficult (out
I need help in turning this linq expression into a linq statment. SampleData.Publishers and
I want to something as simple as turning this is a test into new
I've done a bit of research on this subject and am turning up blanks.
This should be a simple one: I have an observableArray object called To in
After reading several articles on how to fine-tuning my code, I found out that

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.