<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How Can I Exit a For Each Loop?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2005/05/04/how-can-i-exit-a-for-each-loop.aspx</link><description>Hey, Scripting Guy! Is there any way to exit a loop in a script? -- MW 
 Hey, MW. You know, when we started writing this column we intended it to be a simple little thing that answered those basic questions so many beginning scripters have: 
 
 
</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: How Can I Exit a For Each Loop?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2005/05/04/how-can-i-exit-a-for-each-loop.aspx#3534382</link><pubDate>Fri, 23 Nov 2012 19:21:19 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3534382</guid><dc:creator>Todd</dc:creator><description>&lt;p&gt;Your column reminded me that so often I find the answer to what I am looking for here, and I just wanted to say a general thank you to both the script guys and Microsoft for letting them do this. It is a great resource and one I am very thankful for.&lt;/p&gt;
&lt;p&gt;Thanks Again for doing what you do!&lt;/p&gt;
&lt;p&gt;Todd&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3534382" width="1" height="1"&gt;</description></item><item><title>re: How Can I Exit a For Each Loop?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2005/05/04/how-can-i-exit-a-for-each-loop.aspx#3464745</link><pubDate>Fri, 11 Nov 2011 17:30:45 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3464745</guid><dc:creator>lol</dc:creator><description>&lt;p&gt;yeah&lt;/p&gt;
&lt;p&gt; ok thanks, but i do&lt;/p&gt;
&lt;p&gt;n&amp;#39;t quit undrstands it can yo&lt;/p&gt;
&lt;p&gt;u please do it i&lt;/p&gt;
&lt;p&gt;n this.&lt;/p&gt;
&lt;p&gt;a=inputbox (&amp;quot;Message&amp;quot;)&lt;/p&gt;
&lt;p&gt;Set WshShell = WScript.CreateObject (&amp;quot;WScript.Shell&amp;quot;)&lt;/p&gt;
&lt;p&gt;do until (backspace)&lt;/p&gt;
&lt;p&gt;WScript.Sleep 5000&lt;/p&gt;
&lt;p&gt;WshShell.SendKeys (a)&lt;/p&gt;
&lt;p&gt;WScript.Sleep 1000&lt;/p&gt;
&lt;p&gt;WshShell.SendKeys &amp;quot;{enter}&amp;quot;&lt;/p&gt;
&lt;p&gt;loop&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3464745" width="1" height="1"&gt;</description></item><item><title>re: How Can I Exit a For Each Loop?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2005/05/04/how-can-i-exit-a-for-each-loop.aspx#3464733</link><pubDate>Fri, 11 Nov 2011 16:58:47 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3464733</guid><dc:creator>JV</dc:creator><description>&lt;p&gt;a=inputbox (&amp;quot;Message&amp;quot;)&lt;/p&gt;
&lt;p&gt;if a = &amp;quot;&amp;quot; Then Exit Do&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3464733" width="1" height="1"&gt;</description></item><item><title>re: How Can I Exit a For Each Loop?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2005/05/04/how-can-i-exit-a-for-each-loop.aspx#3464729</link><pubDate>Fri, 11 Nov 2011 16:55:48 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3464729</guid><dc:creator>JV</dc:creator><description>&lt;p&gt;For Each element In group&lt;/p&gt;
&lt;p&gt; &amp;nbsp; [statements]&lt;/p&gt;
&lt;p&gt; &amp;nbsp; [Exit For]&lt;/p&gt;
&lt;p&gt; &amp;nbsp; [statements]&lt;/p&gt;
&lt;p&gt;Next [element]&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://msdn.microsoft.com/en-us/library/tywtbxd0(v=vs.85).aspx"&gt;msdn.microsoft.com/.../tywtbxd0(v=vs.85).aspx&lt;/a&gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3464729" width="1" height="1"&gt;</description></item><item><title>re: How Can I Exit a For Each Loop?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2005/05/04/how-can-i-exit-a-for-each-loop.aspx#3464719</link><pubDate>Fri, 11 Nov 2011 16:35:11 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3464719</guid><dc:creator>lol</dc:creator><description>&lt;p&gt;what do you mean with joy?&lt;/p&gt;
&lt;p&gt;and doesn&amp;#39;t need to be backspace, just a &amp;#39;not often used&amp;#39; key. and how should i write it then in vbscript?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3464719" width="1" height="1"&gt;</description></item><item><title>re: How Can I Exit a For Each Loop?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2005/05/04/how-can-i-exit-a-for-each-loop.aspx#3464686</link><pubDate>Fri, 11 Nov 2011 14:14:58 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3464686</guid><dc:creator>Clislixlyx</dc:creator><description>&lt;p&gt;We have this with no joy. &amp;nbsp;Must be to use backspace many times to make joy.&lt;/p&gt;
&lt;p&gt;Please try to make backspace more and you will have joy to.&lt;/p&gt;
&lt;p&gt;Also must write in script not other langauge.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3464686" width="1" height="1"&gt;</description></item><item><title>re: How Can I Exit a For Each Loop?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2005/05/04/how-can-i-exit-a-for-each-loop.aspx#3464671</link><pubDate>Fri, 11 Nov 2011 11:47:05 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3464671</guid><dc:creator>lol</dc:creator><description>&lt;p&gt;hey scripting guy,&lt;/p&gt;
&lt;p&gt;i was wondering how to stop a loop whit a specific key like this:&lt;/p&gt;
&lt;p&gt;a=inputbox (&amp;quot;Message&amp;quot;)&lt;/p&gt;
&lt;p&gt;Set WshShell = WScript.CreateObject (&amp;quot;WScript.Shell&amp;quot;)&lt;/p&gt;
&lt;p&gt;do until (backspace)&lt;/p&gt;
&lt;p&gt;WScript.Sleep 5000&lt;/p&gt;
&lt;p&gt;WshShell.SendKeys (a)&lt;/p&gt;
&lt;p&gt;WScript.Sleep 1000&lt;/p&gt;
&lt;p&gt;WshShell.SendKeys &amp;quot;{enter}&amp;quot;&lt;/p&gt;
&lt;p&gt;loop&lt;/p&gt;
&lt;p&gt;but the (backspace) doesn&amp;#39;t work&lt;/p&gt;
&lt;p&gt;thanks for replying&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3464671" width="1" height="1"&gt;</description></item></channel></rss>