Solved

How to send key storke in batch file

Posted on 2006-12-01
10
8,856 Views
Last Modified: 2008-08-15
Hi Gurus

cd\
cd WINNT\Microsoft.NET\Framework\v1.1.4322\
caspol -ag 1. -Zone Intranet FullTrust

i m having this script in batch file. when i run it do some process and ask me to input y/n

any way to send y "yes" automaically so it wont stop the batch files

Thanks
Dosth
0
Comment
Question by:dosth
  • 3
  • 2
  • 2
  • +1
10 Comments
 
LVL 95

Accepted Solution

by:
Lee W, MVP earned 20 total points
Comment Utility
Couple of methods you can try:

echo y|{command that prompts for input}

or

create a text file, for example, called y.txt, then put a "y" on one line, press enter, save and exit.  

{command that prompts for input}<x:\path\to\file\y.txt

The above option is redirecting input so that instead of taking input from the keyboard, it takes input from the file y.txt (note, you will like need an "enter" or "carriage return" in the file or it would be like typing "y" and never pressing enter.
0
 
LVL 1

Assisted Solution

by:omniru
omniru earned 20 total points
Comment Utility
For this to work you need to feed caspol "yes" string on standard input through input/output redirection. Simplest way is to prepend caspol invocation with "echo <string> |" construct like this:

echo yes | caspol -ag 1. -Zone Intranet FullTrust

Cheers!
0
 
LVL 15

Author Comment

by:dosth
Comment Utility
i would like to give 10 points to leew also

how can i do that

thanks
dosth
0
 
LVL 1

Expert Comment

by:omniru
Comment Utility
May be this FAQ entry can be helpful:

http://www.experts-exchange.com/help.jsp#hi69

Although it says it's impossible to assign less than 20 points.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 95

Expert Comment

by:Lee W, MVP
Comment Utility
You should read the help file.

The first person who provides the answer should be awarded the points.  In cases when you want to split the points, no person can get less than 20 points.  If you wanted to accept both of our answers, you would have had to increase the point value on the question.

If you like I can reopen the question and you can then increase the value and split the points.  Otherwise, I'll let this pass as it was only 20 points, but understand, many people volunteer their time here to help you - your awarding of points is the primary way of thanking them.  People who don't appropriate award points may cause some experts to stop answering your questions because they don't feel you're going to grade properly.

At the very least, you should explain in any question why you selected the answer you did, to be fair to the others who participated.
0
 
LVL 15

Author Comment

by:dosth
Comment Utility
hey

i can increase point :)

please open

thanks
dosth
0
 
LVL 15

Author Comment

by:dosth
Comment Utility
did mistake

i am new, not sure how i can hive 20 - 20 for both
0
 
LVL 3

Expert Comment

by:JamesAperta
Comment Utility
you can use -q on the caspol command line to go "quiet" without user interaction required.  Don't know if this is a new option or not but it's available with the .NET 2 caspol.

eg
caspol -q .....

0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Suggested Solutions

This paper addresses the security of Sennheiser DECT Contact Center and Office (CC&O) headsets. It describes the DECT security chain comprised of “Pairing”, “Per Call Authentication” and “Encryption”, which are all part of the standard DECT protocol.
Find out what Office 365 Transport Rules are, how they work and their limitations managing Office 365 signatures.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

763 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

11 Experts available now in Live!

Get 1:1 Help Now