contrix_ Posted May 19, 2017 Share Posted May 19, 2017 (edited) Hello, I wanted to download files via CMD, and the first way I discovered was FTP. I rent a server and everything worked. The problem is that it takes kinda long to type in the credentials. After some research I found this PowerShell line: powershell (new-object System.Net.WebClient).DownloadFile('http://website.com/file.exe','%TEMP%\file.exe') But I have some questions: What is the part after %TEMP% for? Is that the destination where the files "arrives"? So if i wanted to download it to C:\, I just have to change it to C:\, right? Where can I host the file for free? I found some web server hosting sites, but the only databases I was able to find were FTP and MySQL. Thank you for your help ;) Edited May 19, 2017 by contrix_ Quote Link to comment Share on other sites More sharing options...
digip Posted May 19, 2017 Share Posted May 19, 2017 The %temp% is a windows temp folder that is read in from the systems defined path for the temp folder. You could change this to any directory. If typing a user-name and password is too much to login to ftp, use an ftp client the stores the settings for you and don't use the command line, or, script it. However, know that ftp is a protocol that no matter what, using command line or client, will send all your data in the clear, ie: plain text passwords over the wire and can be sniffed easily. Using something like SCP or SFTP would be a better way to go and avoid plain FTP at all costs if logging into a server remotely, but the service has to setup to enable it. If you don't care about logging into ftp, there is also wget, which you'd have to install on windows, but is already installed on most llinux systems. Works much the same way as the powershell command. wget http://somesite.com/file -O filename.xxx where -O means output and filename.xxx is the file to save it to. You can add a whole path too, just put it in quotes like "c:\user\name\desktop\soem folder on desktop\file.xxx" Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.