So, I'm trying to setup a batch executable inside a website (php in this case), so it would download certain file directly to desired directory, without need for user to interact with it. Basically the plan is if there was a website with mods/in-game builds/worlds for a game, you'd want to download them directly into AppData, and not bother with moving it from Downloads manually. I am using Xampp localhost to test run it (and I did run it as admin).
I searched up online to find how to embed batch inside php, and got to this:
<?php
exec("cd %AppData% && curl <LINK> -o <NAME>.<FILE_SUFFIX>");
?>
I tried with 'system' instead of 'exec', adding 'cmd /c' in front of the command as well, but not working either
I tried a different approach after that, just to test
<?php
exec("start batch.bat");
?>
with this code
@echo
cd %AppData%
curl <LINK> -o <NAME>.<FILE_SUFFIX>
pause
Which resulted in
'curl' is not recognized as an internal or external command, operable program or batch file.
I also tried absolute path instead of relative, but no positive result either.
Now I don't know what else to try and what could be causing this. If there is another viable option to achieve what I've stated above, please do let me know as well.