-1

I'm not very practical so I would like to ask for your help in compiling a batch file

I set the file to automatically start some cmd commands to be able to download videos with destream

@echo OFF cd C:\Windows\destreamer start destreamer -i "url i want to download" pause

Now I would like to insert a command in the batch file that allows me to paste the url of the desired video once the batch file is started without manually editing it in the file itself

Such as the command set / p "var = Enter Name:"

i tried a test but it doesn't work and i also tried to modify it but i don't think it's the correct way could you help me? Thanks in advance

@echo OFF
set /p "var=Enter Name: "
cd C:\Windows\destreamer
start destreamer -i "%var %"
pause
  • 1
    It appears to me, that for you `destreamer` is really `destreamer.cmd` which means you should `call` it, not `start` it. In addition to that, the script only really runs `node.exe --max-http-header-size 32768 build\src\destreamer.js %*`, so you could, I suppose, if you wanted, run `node.exe --max-http-header-size 32768 C:\Windows\destreamer\build\src\destreamer.js -i "%var%"` and bypass the batch file completely. – Compo Oct 04 '20 at 10:08
  • If the author had made more effort in writing `destreamer.cmd`, there wouldn't be a need to change directory, prior to running the script. `build\src\destreamer.js %*` is just plain lazy. Also the script uses `node.exe` but makes no check that it is in the in $PATH or in the same directory as this README file (project root). The site itself does not mention that fact, _but it does for `ffmpeg`_. This means if `node.exe` isn't located, `node.exe --version | findstr "v8."` will fail, and `IF %ERRORLEVEL% EQU 0 GOTO Node8` will trigger `node.exe build\src\destreamer.js %*` which will also fail. – Compo Oct 04 '20 at 10:53

1 Answers1

0

You have been adding an extra space inside '%var%'

@echo OFF
set /p "var=Enter Name: "
cd C:\Windows\destreamer
start "" destreamer -i "%var%"
pause
Wasif
  • 14,755
  • 3
  • 14
  • 34