Download multiple files

Author Message
esnmb

  • Total Posts : 453
  • Scores: 0
  • Reward points : 0
  • Joined: 1/11/2005
  • Location: USA
  • Status: offline
Download multiple files Friday, April 11, 2008 3:58 PM (permalink)
0
This script goes out and seems to write empty files without actually downloading them.
 
Thoughts?
 
$clnt = new-object system.net.webclient
$colFiles = Import-csv C:\temp\DL.csv
foreach ($file in $colFiles)
 {
  $clnt.DownloadFile($file.Files, $file.Path)
 }
 
The csv is formated like:
 
Files,Path
Http://blah.com/file.rar,c:\temp\file.rar
etc,etc
 
#1
    ebgreen

    • Total Posts : 8219
    • Scores: 98
    • Reward points : 0
    • Joined: 7/12/2005
    • Status: offline
    RE: Download multiple files Monday, April 14, 2008 2:21 AM (permalink)
    0
    I think you may have environmental issues. The code that you posted worked just fine for me as is.
    "... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
    Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
    http://www.visualbasicscript.com/m_47117/tm.htm
     
    #2
      esnmb

      • Total Posts : 453
      • Scores: 0
      • Reward points : 0
      • Joined: 1/11/2005
      • Location: USA
      • Status: offline
      RE: Download multiple files Monday, April 14, 2008 2:37 AM (permalink)
      0
      Strange.  I am running on a vista machine.  Are you?
       
      #3
        ebgreen

        • Total Posts : 8219
        • Scores: 98
        • Reward points : 0
        • Joined: 7/12/2005
        • Status: offline
        RE: Download multiple files Monday, April 14, 2008 2:57 AM (permalink)
        0
        Nope XPSP2. If I get a chance I will try it on a Vista machine but I suspect Vista Security may very well be the culprit.
        "... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
        Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
        http://www.visualbasicscript.com/m_47117/tm.htm
         
        #4
          esnmb

          • Total Posts : 453
          • Scores: 0
          • Reward points : 0
          • Joined: 1/11/2005
          • Location: USA
          • Status: offline
          RE: Download multiple files Monday, April 14, 2008 3:17 AM (permalink)
          0
          True.  Thanks for at least verifying that the code was good.
           
          #5

            Online Bookmarks Sharing: Share/Bookmark

            Jump to:

            Current active users

            There are 0 members and 1 guests.

            Icon Legend and Permission

            • New Messages
            • No New Messages
            • Hot Topic w/ New Messages
            • Hot Topic w/o New Messages
            • Locked w/ New Messages
            • Locked w/o New Messages
            • Read Message
            • Post New Thread
            • Reply to message
            • Post New Poll
            • Submit Vote
            • Post reward post
            • Delete my own posts
            • Delete my own threads
            • Rate post

            2000-2012 ASPPlayground.NET Forum Version 3.9