V
V
Vladimir Kivva2017-11-18 09:57:58
cmd/bat
Vladimir Kivva, 2017-11-18 09:57:58

How to change a text file with a script in Windows?

There is a file in Windows with the content: "password=abc user=abc", you need to find this line using cmd and repeat a second time

/interface ovpn-client
add add-default-route=no auth=sha1 certificate=none cipher=blowfish128 \
connect-to=vpn.org disabled=no \
max-mtu=1500 mode=ip name=ovp port=1194 profile= default\
password=abc user=abc

In reality, the cmd-file should add the second mikrotik vpn connection to the rsc-file based on the data of the first one. I don’t know cmd and don’t like it, but this is a prerequisite. Tell me where to read, or examples?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
res2001, 2017-11-18
@res2001

The most sensible and detailed documentation is help on commands, oddly enough.
Each command has built-in help, it is called using the /? key, even for, if, set have such help, and cmd itself /?
You can use a simple script to generate text files describing most commands:
FOR /F "usebackq tokens=1 eol= skip=1 delims=" %%a IN (`help^|findstr /B /V /C:" "`) DO help %%a >>%%a.txt
Also on rsdn.ru there is an article "Batanics Lessons", there is a very good introduction to the topic.
On forum.ru-board.com and forum.script-coding.com there are good threads on the topic, there are "cool peppers" hanging out in botany.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question