Creating a small batch program

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
hacxx
Posts: 57
Joined: 09 Apr 2015 13:18

Creating a small batch program

#1 Post by hacxx » 20 Oct 2018 16:39

Step by step
1) make a get url request using curl
2) save the content of the url in a string/variable
3) extract a few elements from the string/variable

4) Make a post url request with some of the elements in the string/variable
[The elements required are cookies, headers and token]

5) Save the result from post request
6) Locate using Find or something similar to find some elements
7) Make a get request to the elements extracted from Find
8) Print the texts in the console (cmd)
9) Print Using a image program to show the image extracted in console (cmd)

This steps are only theorial can this be done in batch?

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: Creating a small batch program

#2 Post by Squashman » 20 Oct 2018 17:37

What is stopping you from attempting to code this?

hacxx
Posts: 57
Joined: 09 Apr 2015 13:18

Re: Creating a small batch program

#3 Post by hacxx » 20 Oct 2018 17:57

Converting the get request to a string/variable. I don't how to do in cmd

Extract the token, cookie and header from string/variable

Make a POST request and extract the text and the image

Free program to embed images in cmd

ShadowThief
Expert
Posts: 1160
Joined: 06 Sep 2013 21:28
Location: Virginia, United States

Re: Creating a small batch program

#4 Post by ShadowThief » 20 Oct 2018 18:53

The GET request is already a string; or are you trying to store the response in a string? Because that's just

Code: Select all

for /f "delims=" %%A in ('curl [request]') do set "get_response=%%A"
where you replace [request] with whatever the request is. You could also use curl's -o option to store the output in a file.
POST requests can be processed the same way.

Extracting values from the responses will vary based on the response string, but it's also going to be a for /f loop.

I'm not aware of anything that can embed images in the command prompt, and I'm really not sure why you would want this in the first place.

hacxx
Posts: 57
Joined: 09 Apr 2015 13:18

Re: Creating a small batch program

#5 Post by hacxx » 11 Nov 2018 14:55

Thanks that really helped

Post Reply