Advertisement
Guest User

Untitled

a guest
Oct 8th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. q@echo off
  2. FOR /F "TOKENS=1* DELIMS= " %%A IN ('DATE/T') DO SET CDATE=%%B
  3. FOR /F "TOKENS=1,2 eol=/ DELIMS=/ " %%A IN ('DATE/T') DO SET mm=%%B
  4. FOR /F "TOKENS=1,2 DELIMS=/ eol=/" %%A IN ('echo %CDATE%') DO SET dd=%%B
  5. FOR /F "TOKENS=2,3 DELIMS=/ " %%A IN ('echo %CDATE%') DO SET yyyy=%%B
  6. SET date=%yyyy%%mm%%dd%
  7.  
  8.  
  9. wget -v --http-user="username" --http-password=password "http://server/dira/file:format=PDF" -O "C:test%date%file.pdf"
  10.  
  11. wget -v --http-user="username" --http-password=password "http://server/dirb/file2:format=PDF" -O "C:test%date%file.pdf"
  12.  
  13. #Feel free to modify date format via google search
  14. $dateString = Get-Date -f MM-dd-yy
  15. $client = New-Object System.Net.Webclient
  16. $client.Credentials = New-Object System.Net.NetworkCredential("user","pass")
  17.  
  18.  
  19. "File1.pdf","File2.pdf","file3.zip" | % {
  20. $path = "http://somesite.com/files/" + $_
  21. $fileName = "C:downloads" + ($_).Replace(".zip",($dateString + ".zip"))
  22. $client.DownloadFile($path,$fileName)
  23. }
  24.  
  25. start wget -v --http-user="username" --http-password=password "http://server/dira/file:format=PDF" -O "C:test%date%file.pdf
  26.  
  27. start /B wget -v --http-user="username" --http-password=password "http://server/dira/file:format=PDF" -O "C:test%date%file.pdf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement