Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
lazna
- Posts: 62
- Joined: 27 Dec 2012 10:54
#1
Post
by lazna » 04 Jan 2022 05:34
Is there any way to run batch from STDIN/pipe? In linux, there is a possibility to run scripts without save it to disc first:
Code: Select all
curl http://exmaple.com/run.sh |sudo bash
Is something similar possible with batch files?
-
aGerman
- Expert
- Posts: 4678
- Joined: 22 Jan 2010 18:01
- Location: Germany
#2
Post
by aGerman » 04 Jan 2022 10:40
It's possible. However, cmd.exe is going to use command-line-mode rather than script-mode in this case.
This will execute the content of "script.txt" the same way as writing it line by line into a cmd prompt.
Steffen