Jump to content

Powershell | VBS to copy from Http://$i++

My teacher has asked me to save a slide show from a website, well I tried 3 various website rippers and I don't want to copy each image since its nearly 200 slides. But, the image urls are consecutive site/folder/0001.jpg site/folder/0002.jpg.....

My issue is that my schools security policies block most scripts and programs, but for some reason I can run vbs and powershell, which all I know in those is trivial message boxes, shutdown, some other useless things.

Is there a way to essentially

Get image from url

save to folder

add 1 to url

loop

please help, and thank you at least 180 times lol

                     .
                   _/ V\
                  / /  /
                <<    |
                ,/    ]
              ,/      ]
            ,/        |
           /    \  \ /
          /      | | |
    ______|   __/_/| |
   /_______\______}\__}  

Spoiler

[I5-12600k | 32gb DDR5 6000 | RTX5070 | 2x1tb M.2]

 

[Ryzen 5 1600 | 16gb DDR4 3200 | GTX1030 | 4x 8tb HDD] 

 

Link to comment
https://linustechtips.com/topic/580207-powershell-vbs-to-copy-from-httpi/
Share on other sites

Link to post
Share on other sites

Using powershell, create a simple for loop:

for($i = 0; $i -lt 200; $i++) {
	$file = $i -as [string]
	$file = $file.PadLeft(4, "0")
	Invoke-WebRequest website.com/site/folder/$file.png -OutFile C:\somefolder\$file.jpg
}

Haven't tested it, but it should work. Just replace the url with the website url and the output file with where you want to save it

˙ǝɯᴉʇ ɹnoʎ ƃuᴉʇsɐʍ ǝɹɐ noʎ 'sᴉɥʇ pɐǝɹ oʇ ƃuᴉʎɹʇ ǝɹɐ noʎ ɟI

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×