1

I am trying to automate chef setup for windows. So I wrote .bat according to this:

call winrm quickconfig -q
call winrm set winrm/config/winrs @{MaxMemoryPerShellMB="300"}
call winrm set winrm/config @{MaxTimeoutms="1800000"}
call winrm set winrm/config/service @{AllowUnencrypted="true"}
call winrm set winrm/config/service/auth @{Basic="true"}
call netsh advfirewall firewall set rule name="Windows Remote Management (HTTP-In)" profile=public protocol=tcp localport=5985 remoteip=localsubnet new remoteip=any

So I saved this into winrm.bat and run. But console prints forever:

C:\Users\Administrator\Desktop>winrm quickconfig -q

If remove call command from all line result is the same. Also if I remove first line call winrm quickconfig -q result is:

C:\Users\Administrator\Desktop>winrm set winrm/config/winrs @{MaxMemoryPerShellMB="300"}

I pay you attention that it print these line forever, not one line. But when I open console and manually copy and paste commands one by one everything works.

What is wrong? How to "enable" these command run from .bat file?

Cmd is running from Windows Server 2008 x64 SP2. System has been just installed.

1

If your batch file is called winrm.bat and you call (with or without call command) winrm ... probably you have your batch file calling himself.

The easiest solution is to change the batch file name

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.