a222493
asked on
Provide a "Y" answer to a batch file
Hi,
I have the following batch script called dropShares.bat:
net share sharename1 /delete
net share sharename2 /delete
net share sharename3 /delete
net share sharename4 /delete
The "net share" command will sometimes prompt me for a response, thus stopping the batch script. How can I suppress this behavior, or provide several "Y" values?
I have the following batch script called dropShares.bat:
net share sharename1 /delete
net share sharename2 /delete
net share sharename3 /delete
net share sharename4 /delete
The "net share" command will sometimes prompt me for a response, thus stopping the batch script. How can I suppress this behavior, or provide several "Y" values?
ASKER
I type:
echo y | net share applications /delete
and I receive the error:
No valid response was provided.
Am I missing something???
echo y | net share applications /delete
and I receive the error:
No valid response was provided.
Am I missing something???
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Wow, You've gotta be kidding me. I never even tried it because I thought it would be documented....
Thanks
Thanks
can you try it without the spaces around the pipe-symbol (|):
echo y|net share applications /delete
I tried it with something else (echo y | del \temp\*.*) and it worked.. What question is it asking?
echo y|net share applications /delete
I tried it with something else (echo y | del \temp\*.*) and it worked.. What question is it asking?
good one sirbounty :)
It's the little things, eh?
Happy to have helped. 8-)
Happy to have helped. 8-)
:)