1.

Solve : Answering yes when a bat file runs?

Answer»

I am building a bat file to setup .net framework to run. When the command runs it ask if you are sure, it has a y & n. I want it to select y and run from there. does the .net framework install file support command line switching???

if so there might be a slient switch.

the best way to find out is to open the command prompt and loacte said install file, then;

c:\loaction\of\instal\file\setup.exe /?


hope it helps.I deleted my earlier post. Apparently I misunderstood the QUESTION. If indeed the program is called setup, you can use the pipe to forcefeed the response.

Example: echo Y | setup.exe

Note: not all PROGRAMS are written to accept data from the pipe.

CHOSE = command 1 needs.
If 1 does not've DOS 6 1 still has chose ;-)
YN or ASK? or others.
Or CHOSE = included + G.E.M. @ shaneland. llightsey,
Go to the CMD window and try blastman's & Sidewinder's suggestions.
You may find that there is a silent switch, or you may be able to echo the y as Sidewinder suggested. Then you can incorporate the solution in you batch file.


Quote from: AndrewH on May 17, 2008, 05:37:02 AM

CHOSE = command 1 needs.
If 1 does not've DOS 6 1 still has chose ;-)
YN or ASK? or others.
Or CHOSE = included + G.E.M. @ shaneland.

Andrew,

I think you meant Choice.com from DOS, NOT "CHOSE"
Besides that, I don't think choice will help llightsey out here.

blastman & Sidewinder both have viable suggestions that llightsey should pursue first.

This is the bat file i want to run, when it runs it ask if i am sure and I answer YES. I don't want to type the yes in how can I make it auto answer the question and run?

Bat file to allow a PC to run .net programs
color 0a
@cls

c:
cd \windows
cd microsoft.net
cd Framework
cd v2.0.50727
CasPol.exe -m -ag 1.2 -zone Intranet FullTrust set
set PERSIS=/PERSISTENT:YES
pauseDid you research if there is a silent switch? You can try the pipe but there are no guarantees:

Code: [Select]c:
cd \windows\microsoft.net\Framework\v2.0.50727
echo Y | CasPol.exe -m -ag 1.2 -zone Intranet FullTrust set
set PERSIS=/PERSISTENT:YES
pause

If the program is expecting the fullword YES, then echo YES instead of Y.



Any reason the set statement is after the program execute?

Sidewinder, it still wont run unless you type the YES inWell, like I mentioned, not all programs take input from the pipe. Unless you can find a switch for the program to run silently, you may SOL.

Have you tried running the program from the Windows run box?

Code: [Select]"c:\windows\microsoft.net\Framework\v2.0.50727\CasPol.exe -m -ag 1.2 -zone Intranet FullTrust set"

It might be interesting to see if the shell gets activated for the prompt. You can set PERSIS anytime either temporarily thru the batch shell or permanently thru Windows.

Good LUCK. I got it working I found the switch that TURNS the question off
New Code

Bat file to allow a PC to run .net programs
color 0a
@cls

c:
cd \windows\microsoft.net\Framework\v2.0.50727
CasPol.exe -pp off -m -ag 1.2 -zone Intranet FullTrust

Just change the _pp on and it will agin ask you It's always good to hear to success STORY. Thanks for all your help on the Fourm Sidewinder


Discussion

No Comment Found