2

I've uploaded to the internet my batch file code. And I want to know if I can run this batch file (which is now on the internet) from my computer on the cmd. Is there a command to do this? I really don't know how I can do this.

Donald Duck
  • 6,488
  • 18
  • 59
  • 79
Raz Omry
  • 225
  • 1
  • 5
  • 16

2 Answers2

0

you must first download it.You can use the winhttpjs.bat for that purpose:

call winhhtpjs.bat https://example.com/mybat.bat -saveTo "%cd%\mybat.bat"
call mybat.bat 

or with bitsadmin (not every windows have it by default):

bitsadmin /transfer myDownloadJob /download /priority normal https://example.com/mybat.bat "%cd%\mybat.bat"
call mybat.bat

Here you can see more options on how you can download a file

Community
  • 1
  • 1
npocmaka
  • 51,748
  • 17
  • 123
  • 166
0

You can download your file with powershell and batch and start it like this way :

@echo off
set "url=http://hackoo.alwaysdata.net/Matrix.mp3"
set "FileLocation=%userprofile%\Desktop\Matrix.mp3"
echo Please wait ... Downloding file is in progress ...
Call :PSDownload "%url%" "%FileLocation%"
start "" "%FileLocation%"
exit /b
::*********************************************************************************
:PSDownload <url> <File>
Powershell.exe -command "(New-Object System.Net.WebClient).DownloadFile('%1','%2')"
exit /b
::********************************************************************************* 

Just change the URL and FileLocation variables to yours and test it ;)

Hackoo
  • 15,943
  • 3
  • 28
  • 59