How do you download files on a Windows server?

46

23

Related question: Native alternative to wget in Windows PowerShell?

The question might sound stupid, but this is often a major issue for me. Consider the following scenario:

The customer has a fresh Windows Server 2008 based system into which I can connect via RDP. The only available browser is Internet Explorer with the default security guidelines that don't allow you to do anything.

I want to avoid maintaining the "trusted sites" list at all costs!

So this is what doesn't work for me:

  1. Download Chrome (requires JavaScript, which is not available)
  2. Download Firefox (the download location is not trusted, adding it to the trusted sites doesn't help either, because the CDN directs to a different site the next time)
  3. Connecting to a network share of the server (won't let me authenticate, might be another issue).
  4. Sending me the file per mail doesn't work either, because it exceeds the file size limit for messages.

Where is the wget on Windows Server?


Update regarding RDP-based approaches
I assume that some of the proposed solutions did not work for me because the server I was working on when writing the question was accessed through an RDP gateway (from the company's Remote Web Access site).
Additionally, I tried confirming (RDP-related) solutions against other servers I was working on at the time (which were accessed without a gateway).

For example, I believe clipboard sharing is not available when connecting through a gateway. But I have yet to confirm this.

Der Hochstapler

Posted 2012-02-08T14:48:45.617

Reputation: 77 228

Can you not use a thumbdrive and move files to the server? Or from a network share from another computer? – music2myear – 2012-02-08T14:51:58.257

@music2myear The server is at a remote location. – Der Hochstapler – 2012-02-08T14:55:20.457

2You can always download firefox from their FTP server, which is fixed without mirroring – Dennis C – 2012-02-08T15:34:01.083

1

Firefox can be downloaded with a static link. bookmark this link: http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest/win32/en-US/

– Colin Pickard – 2012-02-08T16:47:38.043

Answers

49

Open the Microsoft Powershell and do this:

Import-Module bitstransfer
start-bitstransfer -source http://something/something.ext -destination c:\something.ext

sinni800

Posted 2012-02-08T14:48:45.617

Reputation: 3 048

How would this work for a site that has a download button that activates some JS when triggered? I'm not sure what link to use. – CGTheLegend – 2019-07-09T23:05:40.807

Awesome. This also provides progress feedback, which I don't get with WebClient. – Der Hochstapler – 2012-02-08T15:05:46.557

@OliverSalzburg There's a lot more you can do with it. Start-BitsTransfer returns a BitsTransfer object which has progress info inside. If you use the -asynchronous switch it will run in background, the object will have your progress info. If you run it asynchronous be careful that you HAVE to use Complete-BitsTransfer $transfer to finalize it then though. Try Get-Command -module Bitstransfer. The BitsTransfers running in background utilize the Microsoft BITS service (hence the name). It's awesome! :-) – sinni800 – 2012-02-08T15:10:17.907

I'm reading in the documentation right now. Thanks for the hint :)

– Der Hochstapler – 2012-02-08T15:12:57.840

Impressive, I've never used powershell – Dennis C – 2012-02-08T15:34:26.060

@sinni800 It doesn't seem to work with FTP. Am I missing something? – Der Hochstapler – 2012-02-14T14:05:02.343

@OliverSalzburg Huh, I don't think so... I think it should work. – sinni800 – 2012-02-16T17:26:24.503

Seriously Microsoft? Where is the browser in Windows 8 server? Why do I have to do this just to get a browser? – Dewayne – 2013-02-13T01:10:53.497

@Dewayne I have a browser on my Windows 2012 Server - IE is pre installed. – sinni800 – 2013-02-13T09:55:05.610

This is beautiful. I am now sold on PowerShell. – ChimneyImp – 2013-04-20T14:18:42.840

29

Internet Explorer with the default security guidelines

Why not just turn them off for administrators. Click on the Configure IE ESC link in Server Manager under the Security Information section and change it.

Server Manager

enter image description here

It's three clicks and if memory serves, doesn't even require to close and reopen IE.

Or is the "default security guidelines" also company policy and though you may be able to technically do so, you'd be violating policies... in which case, I don't see how doing the other options wouldn't be just as insecure if not more so. (Security by obscurity is not security).

As for obtaining Firefox (for example), use the command line FTP and download it.

Multiverse IT

Posted 2012-02-08T14:48:45.617

Reputation: 4 228

For windows server 2012 R2 https://blog.blksthl.com/2012/11/28/how-to-disable-ie-enhanced-security-in-windows-server-2012/

– Anders Sandberg Nordbø – 2016-05-25T12:26:24.023

A lot of the companies I deal with have small or no IT department at all. So even If I would document changes, nobody cares about that documentation at that company. So the closer the systems are left to their default state (or the state I found them at), the better. – Der Hochstapler – 2012-02-08T18:08:33.917

2Sorry, but I don't see the relevence. Most of my clients are small businesses as well. Even if you don't want to document things, I don't understand how you could feel downloading a third party browser is LESS intrusive than turning off ESC. And even if you wanted to leave things as they were, how often are you downloading on a server (the answer SHOULD be RARELY). And when you're done, turning it back on is just as simple as turning it off. – Multiverse IT – 2012-02-09T07:43:15.557

I see your point. But I guess I hadn't made myself very clear in the question. I really wanted some wget equivalent that would work out of the box, so that I could quickly pull things from http://live.sysinternals.com for example.

– Der Hochstapler – 2012-02-09T11:04:47.807

That does sound like a different question. There are wget windows ports available online but Windows is not linux and it's not included with any current windows version and likely not any future version. Personally, I make a "free utilities" package available on my web site (I don't advertise it) and then I download that to the systems (workstations and servers) I work on, making a a %windir%\Utils and %windir%\scripts folder on all machines. Then I add it to the system's PATH environment variable. Now I know I have all the tools I might need. – Multiverse IT – 2012-02-09T17:49:52.610

This has actually become my preferred way to deal with the situation that caused me to ask the question. I'm still very glad for the options brought forth by this question and I often use them. But you were right. Thanks :) – Der Hochstapler – 2012-05-15T13:00:52.750

And, for older versions (Server 2003 for example) you have to do following: - Click Start/Control Panel

  • Click Add/Remove Programs
  • Click Add/Remove Windows Components
  • Activate Internet Explorer Enhanced Security Configuration
  • Click Details-button
  • Uncheck For administrators groups
  • Click OK
  • Click Next...
  • < – None – 2012-05-15T07:50:48.357

Thank you! This was the only solution to use HP ALM QC Client on windows servers, which requires activex to download numerous cabs – Eddie – 2013-07-08T19:58:39.720

11

One way to go is to use PowerShell with WebClient:

(New-Object System.Net.WebClient).DownloadFile("http://host/file",".\file")

Der Hochstapler

Posted 2012-02-08T14:48:45.617

Reputation: 77 228

and make sure to use [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 line if you are downloading from HTTPS site. – avs099 – 2019-06-12T21:05:11.963

9

RDP allows you to redirect drives, sounds, printers and even serial ports from the client to the server, use that to transfer installation files to the server.

You can find this as an option in the "Remote Desktop Connection" tool (mstsc):

RDC screenshot

IE has no use in this case and you certainly don't want to install flash or enable js/pdf/java on your server just to download a few files.

Some tools you could use to get rid of the official RDP client:

I use Remmina on a day to day basis to administer my windows servers from my linux desktop.

There is a fork of the mRemote source code, that project is open source free software (GPL) and is named mRemoteNG.

It supports the following protocols: RDP, VNC, ICA (Citrix), SSH, Telnet, HTTP/HTTPS, rlogin and Raw socket connections

Shadok

Posted 2012-02-08T14:48:45.617

Reputation: 3 760

Could you give an example on how to redirect drives? A folder/directory would be preferred though. – Der Hochstapler – 2012-02-08T14:59:57.250

1@OliverSalzburg: The Remote Desktop client that comes with Windows does not support redirecting single folders, only entire drives. The redirected drives will appear under Computer or \\tsclient\<letter>. – user1686 – 2012-02-08T15:02:35.827

2This is definitely my new preferred solution when transferring files from my machine to the remote server. Works well. Thanks :) – Der Hochstapler – 2012-02-08T15:27:10.920

4

If you're using Windows 7 (Pro for sure works) and Windows server 2008, you can just directly copy and paste the .exe files between them. This is without changing anything anywhere. I'm not sure if there is a size limit, I've done up to about 100MB in file size without problems.

On your local computer copy to clipboard firefox.exe

copy

(or whatever) and on the server simply paste. paste

copying

I've tested this with, win2008 to win7pro, win7pro to win2008, win7pro to win7pro. It might work with win7home to win7pro or win2008.

Viper_Sb

Posted 2012-02-08T14:48:45.617

Reputation: 936

I would have assumed that this works, but I can't reproduce this. The Paste option isn't available on the remote site (greyed out). I use Windows 7 Ultimate, the remote site is an SBS2011 Standard. – Der Hochstapler – 2012-02-08T16:26:51.010

Me, win7pro service pack 1, and win2008 R2 standard service pack 1. Can you just do ctrl-c ctrl-v? maybe it's something relatively new? – Viper_Sb – 2012-02-08T16:32:49.407

@OliverSalzburg from this link http://social.technet.microsoft.com/Forums/en/winserverTS/thread/41e6414c-b861-4da4-8575-47f1e3d6f530 Please make sure that Clipboard Redirection is enabled:

  1. On client PC, type mstsc.exe and press Enter.

  2. Click the Options button, click Local Resources tab and make sure that the Clipboard check box has been selected.

•make sure rdpclip.exe is running on remote machine

– Viper_Sb – 2012-02-08T16:38:20.083

I just tried the same thing on another server (SBS2011 Standard as well) and it works perfectly. On the server I originally had the issue with it still doesn't work (Ctrl+C,Ctrl+V doesn't do it either). I think I need to update my original question. – Der Hochstapler – 2012-02-08T16:40:07.760

@OliverSalzburg make sure your settings are correct as per my comment – Viper_Sb – 2012-02-08T16:42:28.173

I think the problem is that I'm initiating the connection to the target through the Remote Web Access portal. When I RDP into machines on my network, clipboard sharing works fine. – Der Hochstapler – 2012-02-08T16:59:03.873

-1

  • Download TeamViewer at TeamViewer.com
  • Install on your Win 7 or any Windows Platform
  • DownLoad TeamViewer to your Win 2008 Server, but don't Install, choose "Run" instead, this will put it into the "Non-Commercial/FREE" mode, otherwise it will recognize that you are installing on a server and only allow the Commercial/FEE version to be installed.
  • Then simply connect the two computers via a TeamViewer Remote Control or File Transfer connection – your choice.

    Remote Control allows you to remotely control another Windows machine and still offers the file Transfer via the toolbar at the top of the screen, or you can start directly with a "File Transfer" connection by choosing the radio box before connecting.

  • Once in the File Transfer mode, a GUI box similar to a FTP box will appear, allowing you to select files in bulk or individually to transfer in between the two computers.

Tech Support

Posted 2012-02-08T14:48:45.617

Reputation: 1

2if a user cannot download files how can he download and install teamviewer ? – Pedro Lobito – 2013-12-28T23:18:44.313