Well, I'm trying to do some automation using batch file to speed up my daily routine at work, and I need to solve these little questions:
- I want to install wget command, but using only the pure Windows Command Prompt
- I want to download some things stored http server online
- These "things" need to be downloaded and placed in the same folder that my batch file resides
- I want these things to be executed and my batch file to be deleted
- Need to perform all operations without "asking permission" of administrator
Please, can you guys do that for me? Or maybe give some help with the first steps?
Best Answer
This answer depends on having PowerShell 3.0 to use the Invoke-WebRequest cmdlet instead of wget. It can be downloaded from here
You could achieve this without creating a file to run this from in the first place. I imagine you're remotely triggering this task somehow, in which case you can do the following:
This way, you leave no trace of a batch file, and you can pick the location where you would like your file to be placed.
To verify the PowerShell version installed is suitable before running the command, wrap it in an if statement like so: