It is really not necessary to create a variable from stdin
, but if it was needed:
@echo off
echo %1
echo %2 Rem Your example input does not show a second input parameter, so this will probably be nothing:
set "web=%~1"
curl -I "%web%"
pause
You can however just use the input %1
as is:
@echo off
echo %1
echo %2
curl -I "%~1"
pause
Usage:
aa.bat http://www.google.com
result:

So here are some valuable hints. open cmd
and type help
where you will find a list of commands. For each of these commands you find interesting, type command name, followed by /?
for instance. set /?
You will be able to find alot of useful information that will help you better understand batch-files
and cmd
. Also remember to run the help for cmd /?
itself.