Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am not a developer, just someone who wants to get things done more efficiently at work...

There's a service at https://www.example.com/service.aspx?id=XXX which I want to run on 100s of values of XXX, from my Windows XP desktop. I don't have a server or dev tools at my disposal. So far I've got as far as a .bat file with multiple lines of "start https://www.example.com/service.aspx?id=XXX", but this doesn't seem to be synchronous and just races through without waiting for the service to actually run. The only other complexity is that it's HTTPS. I've found that by logging in on IE manually then above method will work.

What's the most simple way to run a whole list of URLs synchronously through Windows?

share|improve this question
    
If you mean under synchronously one after another, just remove the start line from the batch. You may have to call browser directly this way. For example: "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" www.google.com will run Google and wait for each process to start before starting next one. –  AndrejaKo Sep 8 '10 at 12:06

1 Answer 1

up vote 1 down vote accepted

Solved my own problem, with the help of http://www.hunlock.com/blogs/Snippets:_Synchronous_AJAX !

    <html>
    <head><script type="text/javascript">
        function GoThroughTextArea() {
            var TA=document.getElementById("ListOfIDs").value;
            if(document.all) { var lines=TA.split("\r\n"); } else { var lines=TA.split("\n"); }
            for(var i=0; i<lines.length; i++) {
                visitID(lines[i]);
            }
        }

        function visitID(oid) {
            theURL = "https://example.com/dothing.aspx?id="+oid;
            if (window.XMLHttpRequest) { AJAX=new XMLHttpRequest(); } else { AJAX=new ActiveXObject("Microsoft.XMLHTTP"); }
            if (AJAX) {
                AJAX.open("GET", theURL, false); AJAX.send(null);
                document.getElementById("responsearea").innerHTML+="Tried ID "+oid+".<br />";
                return true;
            } else {
                document.getElementById("responsearea").innerHTML+="Failed! Problem ID: "+oid+"<br />";
                return false;
            }
        }
    </script></head>
    <body>
    <textarea rows="10" cols="15" id="ListOfIDs"></textarea><button type="button" onclick="GoThroughTextArea()">Start</button>
    <div id="responsearea">Log:<br /></div>
    </body>
</html>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.