Solved

Pass though "yes" answer in batch script

Posted on 2014-03-12
3
1,444 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

706 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

20 Experts available now in Live!

Get 1:1 Help Now