I am looking for the shortest command that would download a file (http) and execute it on Windows.
We assume that the user executing the command is local Administrator and that you cannot use any tools that are not available by default on Windows.
It must work with: Windows 7 and Windows 2008. Extra kudos if someone gives a solution that also works with Windows XP and Windows 2003.
Reasoning: that for deploying stuff on different Windows machines. Using WMI or other methods is not an option because these are not enabled by default and also because machines can be inside our outside a domain, which makes the problem more complex, especially.
Note: If this cannot be done in a command line, a script will do. Let’s assume that the file to be downloaded is located at “http://example.com/setup.exe” and that you want to run it with “-y” parameter after it is downloaded.
You specified http, so using
ftpcommand in command line would not be ok? Maybecscript+VBthen?To download file:
https://serverfault.com/questions/29707/download-file-from-vbscript
To run file: