1

How can I run the following commands in one line? Is it possible or any idea?

winrm delete winrm/config/listener?Address=*+Transport=HTTP  2>$Null
winrm delete winrm/config/listener?Address=*+Transport=HTTPS 2>$Null

winrm quickconfig
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="0"}'
winrm set winrm/config '@{MaxTimeoutms="7200000"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
winrm set winrm/config/service '@{MaxConcurrentOperationsPerUser="12000"}'
winrm set winrm/config/service/auth '@{Basic="true"}'
winrm set winrm/config/client/auth '@{Basic="true"}'
winrm create winrm/config/listener?Address=*+Transport=HTTP
winrm create winrm/config/listener?Address=*+Transport=HTTPS
net stop winrm
net start winrm
Badb0y
  • 331
  • 2
  • 21
  • Possible duplicate of [How to run multiple commands in one line using cmd in windows 10](https://stackoverflow.com/questions/50394413/how-to-run-multiple-commands-in-one-line-using-cmd-in-windows-10) – Sasha Mar 13 '19 at 09:42

1 Answers1

2

You can launch multiple commands on commandline, separating them with a & character:

Prompt>dir & echo test

(This shows all files and puts the word "test" at the end)

Be aware that commandline has a limit, depending of your system (for most Windows systems this is 8191 characters).

More information can be found in this post.

Dominique
  • 16,450
  • 15
  • 56
  • 112