R
robMerritt
Guest
I have a powershell script that will automatically download zip files from a 3rd party
$username='USERNAME'
$password='password'
$ie = New-Object -ComObject 'internetExplorer.Application'
$ie.Visible= $true
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Authenticated/login.asp")
while ($ie.Busy -eq $true){Start-Sleep -seconds 1;}
$usernamefield = $ie.Document.getElementByID('UserID')
$usernamefield.value = $username
$passwordfield = $ie.Document.getElementByID('password')
$passwordfield.value = $password
$Link=$ie.Document.getElementsByTagName("input") | where-object {$_.type -eq "submit"}
$Link.click()
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Authenticated/listing.asp")
Start-Sleep -Second 2
if ( (get-date).DayOfWeek -eq 'Monday')
{
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Auth...0.44\Everlink-FTS\TCUFP\OutTrans\B011SEA1.ZIP")
Start-Sleep -Second 2
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Auth...0.44\Everlink-FTS\TCUFP\OutTrans\B011PEA1.ZIP")
}
elseif ( (get-date).DayOfWeek -eq 'Teusday')
{
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Auth...0.44\Everlink-FTS\TCUFP\OutTrans\B011SEA2.ZIP")
Start-Sleep -Second 2
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Auth...0.44\Everlink-FTS\TCUFP\OutTrans\B011PEA2.ZIP")
}
elseif ( (get-date).DayOfWeek -eq 'Wednesday')
{
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Auth...0.44\Everlink-FTS\TCUFP\OutTrans\B011SEA3.ZIP")
Start-Sleep -Second 2
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Auth...0.44\Everlink-FTS\TCUFP\OutTrans\B011PEA3.ZIP")
}
elseif ( (get-date).DayOfWeek -eq 'Thursday')
{
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Auth...0.44\Everlink-FTS\TCUFP\OutTrans\B011SEA4.ZIP")
Start-Sleep -Second 2
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Auth...0.44\Everlink-FTS\TCUFP\OutTrans\B011PEA4.ZIP")
}
elseif ( (get-date).DayOfWeek -eq 'Friday')
{
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Auth...0.44\Everlink-FTS\TCUFP\OutTrans\B011SEA5.ZIP")
Start-Sleep -Second 2
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Auth...0.44\Everlink-FTS\TCUFP\OutTrans\B011PEA5.ZIP")
}
elseif ( (get-date).DayOfWeek -eq 'Saturday')
{
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Auth...0.44\Everlink-FTS\TCUFP\OutTrans\B011SEA6.ZIP")
Start-Sleep -Second 2
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Auth...0.44\Everlink-FTS\TCUFP\OutTrans\B011PEA6.ZIP")
}
elseif ( (get-date).DayOfWeek -eq 'Sunday')
{
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Auth...0.44\Everlink-FTS\TCUFP\OutTrans\B011SEA7.ZIP")
Start-Sleep -Second 2
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Auth...0.44\Everlink-FTS\TCUFP\OutTrans\B011PEA7.ZIP")
}
this would work fine however the zip files do not download due to this irritating pop up from IE 11 (sunning on windows 2012 server) I tried to add a key as per
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\AttachmentExecute\{0002DF01-0000-0000-C000-000000000046}]
"WinRAR.ZIP"=hex:
but I think the SID/GUID is incorrect for WinRAR.zip , any ideas on how I can eliminate that popup/popover
Continue reading...
$username='USERNAME'
$password='password'
$ie = New-Object -ComObject 'internetExplorer.Application'
$ie.Visible= $true
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Authenticated/login.asp")
while ($ie.Busy -eq $true){Start-Sleep -seconds 1;}
$usernamefield = $ie.Document.getElementByID('UserID')
$usernamefield.value = $username
$passwordfield = $ie.Document.getElementByID('password')
$passwordfield.value = $password
$Link=$ie.Document.getElementsByTagName("input") | where-object {$_.type -eq "submit"}
$Link.click()
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Authenticated/listing.asp")
Start-Sleep -Second 2
if ( (get-date).DayOfWeek -eq 'Monday')
{
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Auth...0.44\Everlink-FTS\TCUFP\OutTrans\B011SEA1.ZIP")
Start-Sleep -Second 2
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Auth...0.44\Everlink-FTS\TCUFP\OutTrans\B011PEA1.ZIP")
}
elseif ( (get-date).DayOfWeek -eq 'Teusday')
{
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Auth...0.44\Everlink-FTS\TCUFP\OutTrans\B011SEA2.ZIP")
Start-Sleep -Second 2
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Auth...0.44\Everlink-FTS\TCUFP\OutTrans\B011PEA2.ZIP")
}
elseif ( (get-date).DayOfWeek -eq 'Wednesday')
{
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Auth...0.44\Everlink-FTS\TCUFP\OutTrans\B011SEA3.ZIP")
Start-Sleep -Second 2
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Auth...0.44\Everlink-FTS\TCUFP\OutTrans\B011PEA3.ZIP")
}
elseif ( (get-date).DayOfWeek -eq 'Thursday')
{
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Auth...0.44\Everlink-FTS\TCUFP\OutTrans\B011SEA4.ZIP")
Start-Sleep -Second 2
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Auth...0.44\Everlink-FTS\TCUFP\OutTrans\B011PEA4.ZIP")
}
elseif ( (get-date).DayOfWeek -eq 'Friday')
{
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Auth...0.44\Everlink-FTS\TCUFP\OutTrans\B011SEA5.ZIP")
Start-Sleep -Second 2
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Auth...0.44\Everlink-FTS\TCUFP\OutTrans\B011PEA5.ZIP")
}
elseif ( (get-date).DayOfWeek -eq 'Saturday')
{
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Auth...0.44\Everlink-FTS\TCUFP\OutTrans\B011SEA6.ZIP")
Start-Sleep -Second 2
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Auth...0.44\Everlink-FTS\TCUFP\OutTrans\B011PEA6.ZIP")
}
elseif ( (get-date).DayOfWeek -eq 'Sunday')
{
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Auth...0.44\Everlink-FTS\TCUFP\OutTrans\B011SEA7.ZIP")
Start-Sleep -Second 2
$ie.Navigate("https://WWW.WEBSITE.COM/Secure/Auth...0.44\Everlink-FTS\TCUFP\OutTrans\B011PEA7.ZIP")
}
this would work fine however the zip files do not download due to this irritating pop up from IE 11 (sunning on windows 2012 server) I tried to add a key as per
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\AttachmentExecute\{0002DF01-0000-0000-C000-000000000046}]
"WinRAR.ZIP"=hex:
but I think the SID/GUID is incorrect for WinRAR.zip , any ideas on how I can eliminate that popup/popover
Continue reading...