Quantcast
Channel: Reboot.pro
Viewing all articles
Browse latest Browse all 6812

Single-line command to download and run file from Windows

$
0
0

Friends,

 

I was looking at the website of a newish company. They have something nice, to try their tool immediately you can run a CURL command and execute the installer right away.

 

Their site detected that I'm using Windows and invited me to try this command:

curl -O download.bowery.io/downloads/bowery_2.1.0_windows_amd64.zip && sudo unzip bowery_2.1.0_windows_amd64.zip -d /usr/local/bin

As you might notice, the command fails because CURL is not available by default on Windows. Perhaps available on Linux and OSX? :huh:

 

In either case, I liked this simple concept to get things running and went ahead to see how this could be done on Windows (I'm running Windows 7).

 

Eventually, found BitsAdmin to work ok for this goal. It has some quirks of its own but can be used. On my test, I placed a batch file that would be downloaded and executed. Here is the syntax:

bitsadmin /transfer test http://triplecheck.de/now %temp%\now.bat & %temp%\now.bat

To ensure that you're not running something dangerous, you can check the content of now.bat directly at http://triplecheck.de/now from your browser.

 

The "&" operator is probably equivalent to "&&" in Unix (I'm somewhat more used to ";") and the %temp% is a variable that points to the Windows temporary folder. It seems that bitadmin doesn't work with specifying where the file will be downloaded.

 

From the now.bat is possible to automate more elaborated steps:

- create a folder on disk

- get the big zip package with the software

- extract all files from the zip package to final location

- launch the software

 

 

Hope you find this tidybit useful. For me it was fun to see this working.

 

:cheers:


Viewing all articles
Browse latest Browse all 6812

Trending Articles