Download and Run a Program

I use this script mainly for downloading and installing software.

Please note that the items in-between the “~~” will need modified.

programdownload.bat
@echo off
 
:DoesDownloadFolderExist
 
IF EXIST "C:\~~FOLDER~~" (GOTO CheckAPP) ELSE (GOTO CreateFolder)
 
:CreateFolder
 
MD "C:\~~FOLDER~~"
 
:CheckAPP
 
IF EXIST "~~C:\FOLDER\APP.exe~~" (GOTO RUN) ELSE (GOTO DOWNLOAD)
 
:DOWNLOAD
 
@powershell -command "(new-object System.Net.WebClient).DownloadFile('~~URL TO FILE~~', '~~LOCATION TO SAVE~~')"
 
:RUN
 
cd C:\~~FOLDER~~
 
~~FILENAME~~
 
:EOF