Answer the question
In order to leave comments, you need to log in
Passing parameters and calling from console bat file?
I need the Bat file to generate the structure of files and folders in the directory where you are in the console. First, as I understand it, you need to throw it in PATH and you can call it anywhere.
How to pass a variable to it from the console. How do I call it from the console. And the main thing is that it generates files and folders not in the directory where it is located, but in the directory where it is called from.
I know I explained it very stupidly, but you probably get the point))
Answer the question
In order to leave comments, you need to log in
The batch file can be called by its full path, regardless of where it lies,
simply by name - yes, if it is in PATH.
for example, such a bat-nickname, let's call it example.bat and save it to c:\Temp\:
dir
echo %1
echo %2
echo %3
echo %*
c:\Temp\example.bat "первый параметр" второй параметр
will output the contents of the current directory and the Том в устройстве D имеет метку Data
Серийный номер тома: ...
Содержимое папки d:\
09.09.2015 17:46 0 1
07.07.2015 16:17 <DIR> ...
05.11.2014 17:56 <DIR> ...
28.07.2014 16:02 <DIR> ...
10.09.2014 19:18 13 234 918 ...
...
6 файлов 37 073 021 байт
27 папок 2 091 204 608 байт свободно
первый параметр
второй
параметр
первый параметр второй параметр
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question