S
S
Stratimon2015-08-29 21:51:37
cmd/bat
Stratimon, 2015-08-29 21:51:37

How to make your command for windows cmd?

Actually, I know that you can write your own bat and run it from the console, but I'm interested in the following how to do this
. An example has a bat os.bat in it
cd D: \ OpenServer \ domains
d:
when you enter in the os console, everything works, but how can I do this would
os\test.dev work
?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Stratimon, 2015-09-01
@Sratimon

@echo off
:factorial %1%
cd /DD:\OpenServer\domains\%1
that's how I wanted it =)

D
DrLabRus, 2015-08-29
@DrLabRus

Batch files can accept parameters / arguments, you just need to add processing.
https://en.wikibooks.org/wiki/Windows_Batch_Script...
It will be used like this
>os path
where path is the path "inside" D:\OpenServer\domains
Theoretically :)

G
GavriKos, 2015-08-29
@GavriKos

What is os\test.dev? Well, it's just very similar that this is the os directory, it contains the test.dev file. And then your question is not clear at all.

A
Alexander Taratin, 2015-08-29
@Taraflex


cd D:\OpenServer\domains
d:
You can just
The rest of the question is not clear.
UPD
@cd /D D:\OpenServer\domains
@cd %1

And run os test.dev
Although in a good way you need to do it through aliases so that it works from any folder and the path does not litter.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question