Solved

Pass though "yes" answer in batch script

Posted on 2014-03-12
3
1,463 Views
Last Modified: 2014-03-13
I am looking to create a batch file to configure WinRM on all windows 7\8 desktops. The command is "winrm quickconfig"

When I run this from a command prompt you have to answer two questions with "y" or "yes." How do I pass those answers through to the batch script to automate the command?
0
Comment
Question by:GR JN
3 Comments
 
LVL 17

Accepted Solution

by:
Chris Millard earned 500 total points
ID: 39923978
add the -quiet switch at the end of the command:-

winrm quickconfig -quiet

Open in new window

0
 
LVL 13

Expert Comment

by:Santosh Gupta
ID: 39924122
Also you can use below command,

%SendKeys% "y{ENTER}"
0
 
LVL 3

Expert Comment

by:Jeremy Tyre
ID: 39924440
Or you could try:

ECHO y | winrm quickconfig

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
On some Windows 7 (SP1) computers, Windows Update becomes super slow even the computer is reasonably fast.  There's one solution that seemed to have worked well for me (after trying a few other suggested solutions).
This Micro Tutorial will give you basic overview of the control panel section on Windows 7. It will depth in Network and Internet, Hardware and Sound, etc. This will be demonstrated using Windows 7 operating system.
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now