Advertisement

02.14.2007 at 10:13AM PST, ID: 22389202
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.0

Download files via VBScript / Add Trusted Sites per Machine via Registry

Asked by sophomERIC in Internet Explorer Web Browser, Windows 2003 Server, VB Script

Tags: , , ,

I am trying to write a VBScript that will download some files to the local machine.

So far I have this:

Dim WSHShell, WSHNetwork, objFSO, IEObject, objXMLHTTP, objADOStream

Set WSHShell = CreateObject("WScript.Shell")
Set WSHNetwork = CreateObject("WScript.Network")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set IEObject = CreateObject("InternetExplorer.Application")
Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")
Set objADOStream = CreateObject("ADODB.Stream")

If (objFSO.FolderExists("C:\Build-Temp\") = False) Then
      objFSO.CreateFolder "C:\Build-Temp\"
End If

Dim localSource

Set localSource = objFSO.GetFolder("C:\Build-Temp\")

' Download needed files
Dim downloadServer, buildFiles, i

downloadServer = "http://SERVERIP/DIRECTORY/"
buildFiles = array("file1.msi","file2.zip","file3.exe")

For i = 0 To UBound(buildFiles)
      GetBinaryFile localSource.Path & "\" & buildFiles(i), localSource & "\" & buildFiles(i)
Next


Sub GetBinaryFile (strURL, strDest)
 
    objXMLHTTP.Open "GET", strURL, false
    objXMLHTTP.Send()
 
    If objXMLHTTP.Status = 200 Then
      objADOStream.Open
      objADOStream.Type = 1 'adTypeBinary
   
      objADOStream.Write objXMLHTTP.ResponseBody
      objADOStream.Position = 0    'Set the stream position to the start
     
            If objFSO.FileExists(strDest) Then
                  objFSO.DeleteFile strDest, ForceIt
            End If
      
      objADOStream.SaveToFile strDest
      objADOStream.Close
    End if

End Sub

The file is there and exists but I always get an error on the line that reads: objXMLHTTP.Send()'

The system can not locate the resource specified.

It is Windows 2003 and IE 7 is installed. The server it is fetching from is on a different subnet than the client but it does have HTTP and HTTPS access to this server. I can see the file when I go to it manually in IE. It is not in my trusted zones and I think that is the cause of the problem.

Now for the hard part, how do I add it to the trusted zones so that it applies to the whole computer?

I've been through this doc: http://support.microsoft.com/kb/182569 but it doesn't seem to be working.

Let's say they are files from MS. I add these keys:

MACHINE\Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\Security_HKLM_only=4,1
MACHINE\Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\Security_options_edit=4,1
MACHINE\Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\Security_zones_map_edit=4,1
MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\live.com\*=4,2
MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\microsoft.com\*=4,2
MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\msn.com\*=4,2
MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\passport.net\*=4,2
MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\windowsupdate.com\*=4,2

This is from a security template file. I copied these keys from a profile that had all of these as trusted sites and then moved them to HKLM as the KB article said to. They don't even show on the list when I look though. The *=4,2 means that '*' is the name of the key, '4' is the data type which in this case is DWORD, and '2' is the numerical value for the key.

When I browse to the file manually I do get the security warning saying I can't download from this site because it isn't trusted so I can verify that. If you have any solutions and/or alternate methods to fetch these files I would appreciate it. I don't want to have to install extra apps, so wget and curl and the like are out.Start Free Trial
[+][-]02.14.2007 at 10:27AM PST, ID: 18533865

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.14.2007 at 10:31AM PST, ID: 18533895

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.14.2007 at 10:32AM PST, ID: 18533911

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.14.2007 at 10:42AM PST, ID: 18533990

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Internet Explorer Web Browser, Windows 2003 Server, VB Script
Tags: trusted, add, sites, vbscript
Sign Up Now!
Solution Provided By: sophomERIC
Participating Experts: 1
Solution Grade: A
 
 
[+][-]02.14.2007 at 10:47AM PST, ID: 18534038

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]02.14.2007 at 10:47AM PST, ID: 18534046

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32