<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5774589090677396256</id><updated>2026-11-04T19:59:01.907-08:00</updated><category term="Tips"/><category term="Command line"/><category term=".Net 4.5"/><category term="Code snippet"/><category term="Identity"/><category term="JavaScript"/><category term="Network"/><category term="Scripting"/><category term="TFS"/><category term="Visual Studio"/><category term="WIF"/><category term="c#"/><title type='text'>Dev thoughts</title><subtitle type='html'>- Microsoft technologies</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gillesperon.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5774589090677396256/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://gillesperon.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Gilles</name><uri>http://www.blogger.com/profile/16133785183690600457</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5774589090677396256.post-2556553681492421558</id><published>2012-04-08T23:36:00.001-07:00</published><updated>2012-04-08T23:36:29.759-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".Net 4.5"/><category scheme="http://www.blogger.com/atom/ns#" term="Identity"/><category scheme="http://www.blogger.com/atom/ns#" term="WIF"/><title type='text'>New identity management in .Net 4.5</title><content type='html'>&lt;p&gt;Originally the management of the identities in the .Net framework was mainly done through the “System.Security.Principal” namespace, with the 2 interfaces “IIdentity” and “IPrincipal” (and the class “WindowsIdentity” for everything around Kerberos and NTLM).&lt;br&gt;Since&amp;nbsp; a few years, lots of improvements have been made in the management of the authentication process, with some new &lt;strong&gt;&lt;font color=&quot;#008000&quot;&gt;claims-based protocols&lt;/font&gt;&lt;/strong&gt; (like &lt;strong&gt;WS-Federation&lt;/strong&gt; or &lt;strong&gt;Saml2&lt;/strong&gt;). In Microsoft world, those protocols can be easily managed through some services like ADFS 2.0 or Azure Access Control Service (ACS) 2.0.&lt;br&gt;In the .Net framework, a new set of API has been released by Microsoft through the &lt;strong&gt;Windows Identity Foundation &lt;/strong&gt; (WIF) sdk (&lt;a title=&quot;http://msdn.microsoft.com/en-us/security/aa570351&quot; href=&quot;http://msdn.microsoft.com/en-us/security/aa570351&quot;&gt;http://msdn.microsoft.com/en-us/security/aa570351&lt;/a&gt;).&lt;/p&gt; &lt;p&gt;For more information regarding this framework till .Net 4.0, I strongly advise you to refer to:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href=&quot;http://www.amazon.com/Programming-Windows-Identity-Foundation-Dev/dp/0735627185/ref=ntt_at_ep_dpt_1&quot; target=&quot;_blank&quot;&gt;Programming Windows Identity Foundation&lt;/a&gt;, by &lt;a href=&quot;http://blogs.msdn.com/b/vbertocci/&quot; target=&quot;_blank&quot;&gt;Vittorio Bertocci&lt;/a&gt; (&lt;a href=&quot;https://twitter.com/vibronet&quot; target=&quot;_blank&quot;&gt;@Vibronet&lt;/a&gt;),&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ff423674.aspx&quot; target=&quot;_blank&quot;&gt;A Guide to Claims-Based Identity and Access Control (2nd Edition)&lt;/a&gt;, from the Microsoft patterns &amp;amp; practices Developer Center.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Till .Net 4.0, this WIF framework was not included directly in the .Net framework.&lt;br&gt;(The sdk was available here: &lt;a href=&quot;http://www.microsoft.com/download/en/details.aspx?id=4451&quot;&gt;http://www.microsoft.com/download/en/details.aspx?id=4451&lt;/a&gt;)&lt;/p&gt; &lt;p&gt;In .Net 4.5 a very nice job has been done by Microsoft, and now “WindowsIdentity” is built upon a new “System.Security.Claims.ClaimsIdentity”.&lt;/p&gt; &lt;p&gt;Till .Net 4.0, you could see that:&lt;/p&gt; &lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieTLxminLcezmxzwKrupFLsSOClbyBsebCUUZF8GU4o-I3OdtP9KLQuPSW5GNl-gJsmTCv5Zm4X1t_QCvkzhSVzuhTSzDp99FJIf3lA7kPqOVRvHEok1p94hyphenhyphenuzm8LHIjLq3Vyk1rkJjcr/s1600-h/WindowsIdentity%25252001%25255B12%25255D.png&quot;&gt;&lt;img title=&quot;WindowsIdentity till .Net 4.0&quot; style=&quot;border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; border-top-width: 0px; margin-right: auto&quot; border=&quot;0&quot; alt=&quot;WindowsIdentity till .Net 4.0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGrKtyl0piJow9pmwdGYwjCPZrT24ZCmsZkGdKjKwnZCEeEjpN8VuQlNKhweD9Ci7vaDLl4kjTaN0BEgeCZYETUlOBfJVawtUilj3QnEYDg8mQCBx2z-D1mcnhIjEWEwxKP4c1dfgBp6Lt/?imgmax=800&quot; width=&quot;631&quot; height=&quot;169&quot;&gt;&lt;/a&gt;&lt;/p&gt; &lt;h4 align=&quot;center&quot;&gt;WindowsIdentity till .Net 4.0&lt;/h4&gt; &lt;p&gt;Now you will get that:&lt;/p&gt; &lt;p align=&quot;center&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyKJTZsKF2VSC1_nglkKS3xszGUG-_YW3rbWsFWpNo0cHH3L_P7mIzg4tlqOL6ZA0R3qOib4o-hYc4BnfD94mwapmGBf47NMgo4MschHy369W0OtTj_CI7Um2qwEGPELL6gjpzmXjF_brq/s1600-h/WindowsIdentity%25252002%25255B3%25255D.png&quot;&gt;&lt;img title=&quot;WindowsIdentity in .Net 4.5&quot; style=&quot;border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px&quot; border=&quot;0&quot; alt=&quot;WindowsIdentity in .Net 4.5&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbUza6L9PItgGkJxW_94lC3edR2Y4RYyLfnQxsvQMji58i53NCA7lYbTYMSLrz8rWjJKqmKyY-siR_Ci702phnvN7Zzz1UN1R1C_Few-oVvMBbUJok8lnzNsvwkSjcDuTIcG4bJ1Tv-xes/?imgmax=800&quot; width=&quot;715&quot; height=&quot;168&quot;&gt;&lt;/a&gt;&lt;/p&gt; &lt;h4 align=&quot;center&quot;&gt;WindowsIdentity in .Net 4.5&lt;/h4&gt; &lt;p&gt;All the old properties are still here.&lt;br&gt;You can check in the 2 following screenshots that all the properties from WindowsIdentity till .Net 4.0 are still available in the .Net 4.5 version:&lt;/p&gt; &lt;p align=&quot;center&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRuiWcVRsKyyGs1w8L0u7RUQ_tWZK3ujmEyj90RUpd3MFq_uOKghrLNnk9I-KEnVLJgAjeLms9j68iIHiP7B6rMDvpQ9r1SSIRJveGNYBOE1e6hnprqlYIo_OLeBvxzyAtVl5TO3eTjBSW/s1600-h/WindowsIdentity%25252003%25255B3%25255D.png&quot;&gt;&lt;img title=&quot;WindowsIdentity entry for the current user under .Net 4.0&quot; style=&quot;border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px&quot; border=&quot;0&quot; alt=&quot;WindowsIdentity entry for the current user under .Net 4.0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0Ic6P59-mVm9ZfXCNkEdbA0yVq7gRZEKN7wgDYFBXs-XIrerPIA8H-ymF1efXwsAwbJYtrzJ7ykwXlGNS4cYymi2yvlpwy9btrhHHFHKE7We-AqHRwdCmIpirsekqdsp7VCZyeqTRVGZR/?imgmax=800&quot; width=&quot;679&quot; height=&quot;296&quot;&gt;&lt;/a&gt;&lt;/p&gt; &lt;h4 align=&quot;center&quot;&gt;WindowsIdentity entry for the current user under .Net 4.0&lt;/h4&gt; &lt;p align=&quot;center&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjC2VA_vNJTpcG9_veqXHa_HGbHqoIn2J9V1UBhy3O9miEr5eFdI200LidycETyc9Tq67neEOoH2BbJQy0JcZD3iWDLgS8wu3uGtAXx3ieQdGr95F1IhN3H2HRTBee1p8oFVAjhnjGaQbkA/s1600-h/WindowsIdentity%25252004%25255B3%25255D.png&quot;&gt;&lt;img title=&quot;WindowsIdentity 04&quot; style=&quot;border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px&quot; border=&quot;0&quot; alt=&quot;WindowsIdentity 04&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPzAZIu_fp9jPlEjMqal7ZdQ-drb_fDr9fTYo1kH2XGSl6RjvWwR6pM8L1BnD64vhmSNH2AF2uqg7dY9rgfy8_RXWEhCo6pNlr0o9TP-yKDjtKG4HbAuvTlfd5MJF_eb5p5rmPBBmjFReq/?imgmax=800&quot; width=&quot;587&quot; height=&quot;437&quot;&gt;&lt;/a&gt;&lt;/p&gt; &lt;h4 align=&quot;center&quot;&gt;WindowsIdentity entry for the current user under .Net 4.5&lt;/h4&gt; &lt;p&gt;By the way, you can notice at the same time the new “AuthenticationType” “&lt;strong&gt;LiveSSP&lt;/strong&gt;” that allows to use a &lt;strong&gt;LiveId&lt;/strong&gt;.&lt;br&gt;This “LiveSSP” is not really new. It was already available in IIS in Windows 7 and 2008 R2 (&lt;a title=&quot;http://technet.microsoft.com/en-us/library/cc771945.aspx&quot; href=&quot;http://technet.microsoft.com/en-us/library/cc771945.aspx&quot;&gt;http://technet.microsoft.com/en-us/library/cc771945.aspx&lt;/a&gt;).&lt;br&gt;Here again you can see that Microsoft did a great job to integrate correctly everything.&lt;/p&gt; &lt;p&gt;Manipulating claims and tokens will probably be greatly eased with those new objects. Retrieving all the claims for a user becoming really easy:&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhX5WllKp6cpVFabLS4w3IQrsOD_3k9Tucxlqj0oj-EZsR8oyoZbwBd5UgykqwtpDkJ0ZcS4q6rATZunUuGNInSd8VhzqESFYUwVFPoZ38emktjHUNGQL9ehpFF3ICQd4xflSTnH4p1CXDS/s1600-h/WindowsIdentity%25252005%25255B3%25255D.png&quot;&gt;&lt;img title=&quot;All the claims for the current user (most important properties being &amp;ldquo;Type&amp;rdquo; and &amp;ldquo;Value&amp;rdquo;)&quot; style=&quot;border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; border-left: 0px; display: block; padding-right: 0px; margin-right: auto&quot; border=&quot;0&quot; alt=&quot;All the claims for the current user (most important properties being &amp;ldquo;Type&amp;rdquo; and &amp;ldquo;Value&amp;rdquo;)&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx7ESUR7ucfaz95fH2TR5314O9gQkCc0yF5QJtO_5YH23g2m7KC0c__D2-yTkMUN9pDtuBlQhGfUVgFUUWDGogBFl1mC73gY2UqjIWlxOg9FFRsT2WZ65VIwgFOyB7-HFt56Btc8IosctD/?imgmax=800&quot; width=&quot;592&quot; height=&quot;437&quot;&gt;&lt;/a&gt;&lt;/p&gt; &lt;h4 align=&quot;center&quot;&gt;All the claims for the current user (most important properties being “Type” and “Value”)&lt;/h4&gt; &lt;p&gt;For people working with identities, working with .Net 4.5 should be quite interesting! &lt;img class=&quot;wlEmoticon wlEmoticon-smile&quot; style=&quot;border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none&quot; alt=&quot;Smile&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgj6ROVi77esdgNo5fgsXWmt9rdXpX_iGXkmNzSZzaw_Nf0N5xmIk070qSXeuF7_L913oCMKf9yuayGdLdlhJROgDHS1ttgR0NoKFHDc1ppX1_VrgIW4ZX5CFIbgDG-AQIj8Ib7igxUC-n/?imgmax=800&quot;&gt;&lt;/p&gt; &lt;p&gt;This is outside the scope of this note, but let’s finish with a link about the &lt;strong&gt;new Kerberos features in Windows Server 8&lt;/strong&gt;: &lt;a title=&quot;http://technet.microsoft.com/en-us/library/hh831747.aspx&quot; href=&quot;http://technet.microsoft.com/en-us/library/hh831747.aspx&quot;&gt;http://technet.microsoft.com/en-us/library/hh831747.aspx&lt;/a&gt;&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://gillesperon.blogspot.com/feeds/2556553681492421558/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gillesperon.blogspot.com/2012/04/new-identity-management-in-net-45.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5774589090677396256/posts/default/2556553681492421558'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5774589090677396256/posts/default/2556553681492421558'/><link rel='alternate' type='text/html' href='http://gillesperon.blogspot.com/2012/04/new-identity-management-in-net-45.html' title='New identity management in .Net 4.5'/><author><name>Gilles</name><uri>http://www.blogger.com/profile/16133785183690600457</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGrKtyl0piJow9pmwdGYwjCPZrT24ZCmsZkGdKjKwnZCEeEjpN8VuQlNKhweD9Ci7vaDLl4kjTaN0BEgeCZYETUlOBfJVawtUilj3QnEYDg8mQCBx2z-D1mcnhIjEWEwxKP4c1dfgBp6Lt/s72-c?imgmax=800" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5774589090677396256.post-7190633653017779665</id><published>2012-04-08T05:02:00.003-07:00</published><updated>2012-04-08T05:03:09.811-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="Code snippet"/><category scheme="http://www.blogger.com/atom/ns#" term="Network"/><title type='text'>Snippet c#: Detect if a hostname or an IP is the local machine</title><content type='html'>&lt;p&gt;Here is a simple and efficient code snippet to detect if a string represents the local machine or not.&lt;br /&gt;
Basically it will return ‘true’ for values like: “localhost”, “127.0.0.1”, “::1”, …&lt;/p&gt;&lt;pre class=&quot;brush:csharp&quot;&gt;public static bool IsLocalhost(string hostNameOrAddress)
{
    if (string.IsNullOrEmpty(hostNameOrAddress))
        return false;

    try
    {
        // get host IP addresses
        IPAddress[] hostIPs = Dns.GetHostAddresses(hostNameOrAddress);
        // get local IP addresses
        IPAddress[] localIPs = Dns.GetHostAddresses(Dns.GetHostName());
        // test if any host IP is a loopback IP or is equal to any local IP
        return hostIPs.Any(hostIP =&amp;gt; IPAddress.IsLoopback(hostIP) || localIPs.Contains(hostIP));
    }
    catch
    {
        return false;
    }
}
&lt;/pre&gt;&lt;script src=&quot;http://gillesperon-syntaxhighlight.googlecode.com/hg/code.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;&lt;br /&gt;
&lt;p&gt;(Note: to use it you need to reference “System.Net” that contains “IPAddress”)&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://gillesperon.blogspot.com/feeds/7190633653017779665/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gillesperon.blogspot.com/2012/04/snippet-c-detect-if-hostname-or-ip-is.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5774589090677396256/posts/default/7190633653017779665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5774589090677396256/posts/default/7190633653017779665'/><link rel='alternate' type='text/html' href='http://gillesperon.blogspot.com/2012/04/snippet-c-detect-if-hostname-or-ip-is.html' title='Snippet c#: Detect if a hostname or an IP is the local machine'/><author><name>Gilles</name><uri>http://www.blogger.com/profile/16133785183690600457</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5774589090677396256.post-7458727196929469955</id><published>2011-10-25T07:29:00.000-07:00</published><updated>2011-10-25T07:29:00.198-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="TFS"/><category scheme="http://www.blogger.com/atom/ns#" term="Tips"/><category scheme="http://www.blogger.com/atom/ns#" term="Visual Studio"/><title type='text'>Tips: Useful commands for TFS in Visual Studio</title><content type='html'>This post is a short remember of 2 TFS command lines I use a lot.&lt;br /&gt;
Because of that, I like to have them defined as &quot;External Tools&quot; in Visual Studio.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #073763; font-family: Verdana, sans-serif;&quot;&gt;Command 1: Preview of a get latest&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
I like to know exactly what I will get before getting it [therefore I can know when a merge will be required before starting it... No need to have a bad surprise when it can be avoided!]&lt;br /&gt;
&lt;br /&gt;
This first command is in fact the classic &quot;get&quot;, with the option &quot;/preview&quot;.&lt;br /&gt;
Which gives:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;c:\program files (x86)\microsoft visual studio 10.0\Common7\IDE\TF.exe get /preview /recursive&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Here how you can integrate it in Visual Studio.&lt;br /&gt;
Select &quot;Tools&quot; &amp;gt; &quot;External Tools…&quot;, and then create a new entry:&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhglqbv7MLjvBGDSLsP8aXX89WM9ncKptPXmsy1jjxbX7D5XYVagvV80bFNxeTqOBNLtrPlUVKzw62HBiHW4ONvUZBwbfxAHPqqRd4Yz2F6cZlRpyJOP4OOCmx5MX7xfrYFuloRoK1G-CFp/s1600/TFS+-+Get+Latest+Preview.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhglqbv7MLjvBGDSLsP8aXX89WM9ncKptPXmsy1jjxbX7D5XYVagvV80bFNxeTqOBNLtrPlUVKzw62HBiHW4ONvUZBwbfxAHPqqRd4Yz2F6cZlRpyJOP4OOCmx5MX7xfrYFuloRoK1G-CFp/s1600/TFS+-+Get+Latest+Preview.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Creation of the command &quot;TFS Test Get&quot;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Values should be:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;A meaningful title ☺&lt;/li&gt;
&lt;li&gt;Command: &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;c:\program files (x86)\microsoft visual studio 10.0\Common7\IDE\TF.exe&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Arguments: &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;get /preview /recursive&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Initial directory: &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;$(SolutionDir)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Select the option &quot;Use Output window&quot;&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;b&gt;&lt;u&gt;Observation&lt;/u&gt;:&lt;/b&gt; this command is interesting to know which files will be updated, and if some merges will be required, however I strongly advise any TFS user to use&amp;nbsp;&lt;a href=&quot;http://www.attrice.info/cm/tfs/&quot;&gt;Team Foundation Sidekicks&lt;/a&gt;.&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #073763; font-family: Verdana, sans-serif;&quot;&gt;Command 2: Undo unchanged checked out files&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
In TFS a file must be checked out before being modified.&lt;br /&gt;
The &quot;check out&quot; operation can be automated (no prompt will appear), but very often some files are checked out without being modified... (because you did a modification but canceled it after, or because a whole group of files have been checked out at the same time, or those annoying &quot;*.vspscc&quot; files...)&lt;br /&gt;
&lt;br /&gt;
This second command is available in the power tools and allows to cancel the check out of all the files that don&#39;t contain any modification.&lt;br /&gt;
Here is the command:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;C:\Program Files (x86)\Microsoft Team Foundation Server 2010 Power Tools\TFPT.EXE uu /noget /recursive&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Here again how you can integrate it in Visual Studio.&lt;br /&gt;
Select &quot;Tools&quot; &amp;gt; &quot;External Tools…&quot;, and then create a new entry:&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaeiyb9kp8fh7_NqPmhIYJDMjCXH4Kr4Lxhku5_4XYG5TIMIxo2mwiqZ7xCDKOOsiM8kYP5CXJTNBtCEosK14DFc3q9xSwTYULro4hZv_zM2xe7X8Q2UzxHHk2D0D7M85XRJrZketc7xmZ/s1600/TFS+-+Undo+unchanged+checked+out+files.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaeiyb9kp8fh7_NqPmhIYJDMjCXH4Kr4Lxhku5_4XYG5TIMIxo2mwiqZ7xCDKOOsiM8kYP5CXJTNBtCEosK14DFc3q9xSwTYULro4hZv_zM2xe7X8Q2UzxHHk2D0D7M85XRJrZketc7xmZ/s1600/TFS+-+Undo+unchanged+checked+out+files.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Creation of the command &quot;TFS uu&quot; (&quot;uu&quot; standing for &quot;undo unchanged&quot;)&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;Values should be:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;A meaningful title ☺&lt;/li&gt;
&lt;li&gt;Command: &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;C:\Program Files (x86)\Microsoft Team Foundation Server 2010 Power Tools\TFPT.EXE&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Arguments: &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;uu /noget /recursive&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Initial directory: &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;$(SolutionDir)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Select the option &quot;Use Output window&quot;&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;b&gt;&lt;u&gt;Observations&lt;/u&gt;:&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;I always run this command before any commit or any shelve, therefore I know exactly what I will commit,&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;If you are in a situation in which some files have been modified in your workspace without having been checked out (meaning that TFS does not know there are some modifications), you can quickly find them by doing a recursive checked out of all the files, and then calling this command.&lt;/i&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #073763; font-family: Verdana, sans-serif;&quot;&gt;Last advice: Create some shortcuts&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Because I am using those commands before each get latest and before each commit, I usually like to define some shortcuts to call them quickly.&lt;br /&gt;
Those commands are among a few ones I even put in the main menu bar.&lt;br /&gt;
To do so, you can do a right click on the main menu bar, and select &quot;Customize…&quot;.&lt;br /&gt;
&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyhBLsa8XPvT8q8K-YaXATwK-DZiKfEpeLQGnfNdBN_jdJMTLe7pZ1k9xzao0YBIoyPcCAffAYogYAVFgbsgC8-YrMZZlM-l1K9uwA38zEnfL-Zb2sq-lMS4Z-MHKGO1ceQFEmaPFdd69y/s1600/TFS+-+Define+shortcuts.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyhBLsa8XPvT8q8K-YaXATwK-DZiKfEpeLQGnfNdBN_jdJMTLe7pZ1k9xzao0YBIoyPcCAffAYogYAVFgbsgC8-YrMZZlM-l1K9uwA38zEnfL-Zb2sq-lMS4Z-MHKGO1ceQFEmaPFdd69y/s1600/TFS+-+Define+shortcuts.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Add your external commands&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;Notice that you will not see the name of your commands in the &quot;Customize&quot; panel. You will see &quot;External Command #&quot;. However the names will be ok (and you can even put some icons if you prefer).&lt;br /&gt;
&lt;br /&gt;
That&#39;s it for those 2 basic but useful commands.&lt;br /&gt;
G&lt;br /&gt;
&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gillesperon.blogspot.com/feeds/7458727196929469955/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gillesperon.blogspot.com/2011/10/tips-useful-commands-for-tfs-in-visual.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5774589090677396256/posts/default/7458727196929469955'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5774589090677396256/posts/default/7458727196929469955'/><link rel='alternate' type='text/html' href='http://gillesperon.blogspot.com/2011/10/tips-useful-commands-for-tfs-in-visual.html' title='Tips: Useful commands for TFS in Visual Studio'/><author><name>Gilles</name><uri>http://www.blogger.com/profile/16133785183690600457</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhglqbv7MLjvBGDSLsP8aXX89WM9ncKptPXmsy1jjxbX7D5XYVagvV80bFNxeTqOBNLtrPlUVKzw62HBiHW4ONvUZBwbfxAHPqqRd4Yz2F6cZlRpyJOP4OOCmx5MX7xfrYFuloRoK1G-CFp/s72-c/TFS+-+Get+Latest+Preview.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5774589090677396256.post-8637375295180234053</id><published>2011-05-03T08:10:00.000-07:00</published><updated>2011-05-03T08:10:00.219-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript"/><category scheme="http://www.blogger.com/atom/ns#" term="Tips"/><title type='text'>Tips: Use JavaScript commands in your browser</title><content type='html'>Do you know that it is possible to manually execute JavaScript commands directly in your favorite browser? [Internet Explorer, Firefox, Chrome or whatever…]&lt;br /&gt;
When you are on a website, you can write a JavaScript command and execute it.&lt;br /&gt;
Here is a basic test:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;javascript:alert(&#39;Hello world!&#39;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZq8L-e6-3ypAKP1UN4epvLBSO9D9uD3mFm64GuwVd5IleIXXq0vLvUZSHT87k3FwkhhhkOUZj7UAHbl46o53BLX_WyYsCtNdw-Q1Qkp6w58p91RFNFRDvTdlaT4jtNVYV6ixKBJKkgg8h/s1600-h/image9.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Execution of a basic JavaScript command directly in a browser&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjamcoYY5a25FIlZJwpeF29KU8CqHzmtLW8tBuHbjHelKhdRTlsNwjeC8FY5RaF6d6EZhwRaY4qM3ULykphccHT4W5yN5fpLLfetViuCczZ-x11oca06rMZiVfH_XJEBefpWzEBVD8pMfEw/?imgmax=800&quot; style=&quot;background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;Execution of a basic JavaScript command directly in a browser&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Execution of a basic JavaScript command directly in a browser&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;This possibility allows to do lots of interesting things.&lt;br /&gt;
Here are two commands I think very useful:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: green; font-size: large;&quot;&gt;&lt;strong&gt;1. The Printliminator&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://css-tricks.com/examples/ThePrintliminator/&quot; title=&quot;http://css-tricks.com/examples/ThePrintliminator/&quot;&gt;http://css-tricks.com/examples/ThePrintliminator/&lt;/a&gt;&lt;br /&gt;
This command allows to modify a page before printing it (by removing some parts).&lt;br /&gt;
Therefore you can print only the content that interests you.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;javascript:(function(){function%20loadScript(a,b){var%20c=document.createElement(&#39;script&#39;);c.type=&#39;text/javascript&#39;;c.src=a;var%20d=document.getElementsByTagName(&#39;head&#39;)[0],done=false;c.onload=c.onreadystatechange=function(){if(!done&amp;amp;&amp;amp;(!this.readyState||this.readyState==&#39;loaded&#39;||this.readyState==&#39;complete&#39;)){done=true;b()}};d.appendChild(c)}loadScript(&#39;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js?ver=1.3.2&#39;,function(){loadScript(&#39;http://css-tricks.com/examples/ThePrintliminator/js/printliminator.js&#39;,function(){printlimator()})})})()&lt;/span&gt;&lt;/blockquote&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
Here is an example:&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkUEd5fAW-5kCD5L0SuTb39JCHvCXPEr6SaYf_hyublLFZ4je11UDjGngX-EY5s37x_i97HCOSXvlxsjkAjPHB3s96tPkRScHoTQizn0sao9e1g-eKejZ2oq-pgYiucOir47SVBGqG-9Ms/s1600-h/image14.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Original site&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjC34YR1J5Coz8zEfW0yyDUK2Gy6yb3Ap_Ea37vedHWCA_nt2OxHUjTXBjuiacYNr4EWvvXnyvJsktPJUOTr5h1DHYw7lz-0HAiMGN1Xky6vXU7GI-PHMrjrFopCknFCl7q43Y2J-Gb3rAs/?imgmax=800&quot; style=&quot;background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;Original site&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Original site&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWFxNEvZy876bBnGW_-Y7Ft_rPRo7a7uVk0XtggRab8Uf_8swGNaisyVDe8YUQlU68U08WHEvVHY2M1z9BjtvoE03l1N08vnlgtBZOmwOKOuFKP1moni_6L1cuITAD3lIzhnaSuA7DocJw/s1600-h/image22.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Modifications using the Printliminator&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPQpGk4rGHEj6Q6Zo0jC0z-5CHqCUrOMyTJR5UsznmLNSgE9WSN9vZG-M2-_b7WSgvNOzBxGhInURFjNL35X3SNZbt_N0nCmbVhaEhBkWDRrq64WIBDaeKCdCneOcDbYuAQM6KmQd2Gq_B/?imgmax=800&quot; style=&quot;background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;Modifications using the Printliminator&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Modifications using the Printliminator&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgziCiSofGdLGqDXj3nqaN4rj1ZAoiRBze9-g_IZj0TyTPdkBY_hkAZO3FATpWfuHyqSzC9kThO-wCb92mYpaFpLwZTTqPvWp4qsMNrTbHlvf3MPZotgMGsIm_sifbZY7RPNa18m8va4EfD/s1600-h/image26.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Result with only what we want to print&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivVjcF-UnTMv7flUjP6I2FtiKLMvJk-7LZIA7CB96YXtBTkOyz81f66r_kOLC7ypuqBtGgBoOQCf7_z8dt1ituGOz32xppVmyeSmiTdipu2mTUu9-4dR6r9VslDC60UmNs6daXFDGSCZO0/?imgmax=800&quot; style=&quot;background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;Result with only what we want to print&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Result with only what we want to print&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;span style=&quot;color: green; font-size: small;&quot;&gt;&lt;strong&gt;&lt;br /&gt;
&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: green; font-size: large;&quot;&gt;&lt;strong&gt;2. Show password field hidden values&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.mydigitallife.info/show-or-verify-asterisk-password-field-hidden-value-with-view-passwords-bookmarklet/&quot;&gt;http://www.mydigitallife.info/show-or-verify-asterisk-password-field-hidden-value-with-view-passwords-bookmarklet/&lt;/a&gt;&lt;br /&gt;
This command shows the values of the password fields in a page.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;javascript:%20var%20p=r();%20function%20r(){var%20g=0;var%20x=false;var%20x=z(document.forms);g=g+1;var%20w=window.frames;for(var%20k=0;k&amp;lt;w.length;k++)%20{var%20x%20=%20((x)%20||%20(z(w[k].document.forms)));g=g+1;}if%20(!x)%20alert(&#39;Password%20not%20found%20in%20&#39;%20+%20g%20+%20&#39;%20forms&#39;);}function%20z(f){var%20b=false;for(var%20i=0;i&amp;lt;f.length;i++)%20{var%20e=f[i].elements;for(var%20j=0;j&amp;lt;e.length;j++)%20{if%20(h(e[j]))%20{b=true}}}return%20b;}function%20h(ej){var%20s=&#39;&#39;;if%20(ej.type==&#39;password&#39;){s=ej.value;if%20(s!=&#39;&#39;){prompt(&#39;Password%20found%20&#39;,%20s)}else{alert(&#39;Password%20is%20blank&#39;)}return%20true;}}&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.mydigitallife.info/show-or-verify-asterisk-password-field-hidden-value-with-view-passwords-bookmarklet/?replytocom=800112#respond&quot;&gt;&lt;br /&gt;
&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.mydigitallife.info/show-or-verify-asterisk-password-field-hidden-value-with-view-passwords-bookmarklet/?replytocom=800112#respond&quot;&gt;&lt;img alt=&quot;Showing hidden fields&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRN4Etm851jswwMqP_jYQ6aDjxBt8rSj7sehdjSlxRXrkAR6kZrft-PX8nmCvZIq0eu5J9k0GVIQjHOl8qkztw-UeHyPQI2Hmlu7J2TzOMJuL9MgoDnovUp5eSL9Ph42G_ff3FEtRpTlUW/?imgmax=800&quot; style=&quot;background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;Showing hidden fields&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;hr /&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-text-decorations-in-effect: none; color: black;&quot;&gt;Those were 2 useful functionalities.&lt;/span&gt;&lt;br /&gt;
There are way more.&lt;br /&gt;
Here are 2 “funny” ones:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: green; font-size: large;&quot;&gt;&lt;strong&gt;1. Edit any web page/site&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
This one is really basic, but it can be handy sometimes (for example before doing a screenshot, or why not for some pranks!).&lt;br /&gt;
Of course this will not allow you to edit the real web site!&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;javascript:document.body.contentEditable=&#39;true&#39;; document.designMode=&#39;on&#39;;void 0&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;span style=&quot;color: green; font-size: large;&quot;&gt;&lt;strong&gt;2. Destroy any web page/site&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
What about destroying a website using a spaceship!&lt;br /&gt;
There are several funny scripts ready to use on the internet that allows to do that. Here’s one of them from &lt;a href=&quot;http://erkie.github.com/&quot;&gt;http://erkie.github.com/&lt;/a&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;javascript:var%20s%20=%20document.createElement(&#39;script&#39;);s.type=&#39;text/javascript&#39;;docume&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt; nt.body.appendChild(s);s.src=&#39;http://erkie.github.com/asteroids.min.js&#39;;void(0);&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3xz1q9rMs6AuVxgTJqjBAdB71MQPONKNPl4L9O0-5FjoJ8yz40mZ9P52KjjIgF_T-viBc6n-iSOjLmshL_P-6bMg-bd4fbnJC_cQDFCD3TXJQaOP6UdbiCiJz-XZkybrgSl9UvlF9_3Hp/s1600-h/image%5B7%5D.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiM2bx7NNKCdIl36KGqAkOU-Otivlikd1c0mFKmsbqPsVCu4doJuemRadTGeklv0iezrgfFcFiyMA9lwGoiwLTPPywuz5AAEsHxYaIHoEq-cxe__S5kJtOu7be9BeIN5KXrrxEm-g3CFOoL/?imgmax=800&quot; style=&quot;background-image: none; border-bottom-color: initial; border-bottom-style: initial; border-bottom-width: 0px; border-left-color: initial; border-left-style: initial; border-left-width: 0px; border-right-color: initial; border-right-style: initial; border-right-width: 0px; border-top-color: initial; border-top-style: initial; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;image&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;You can direct the spaceship!&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;hr /&gt;That’s it.&lt;br /&gt;
&lt;br /&gt;
A last thing:&lt;br /&gt;
you can create bookmarks with those JavaScript commands. Therefore you will be able to execute them easily!</content><link rel='replies' type='application/atom+xml' href='http://gillesperon.blogspot.com/feeds/8637375295180234053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gillesperon.blogspot.com/2011/05/tips-use-javascript-commands-in-your.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5774589090677396256/posts/default/8637375295180234053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5774589090677396256/posts/default/8637375295180234053'/><link rel='alternate' type='text/html' href='http://gillesperon.blogspot.com/2011/05/tips-use-javascript-commands-in-your.html' title='Tips: Use JavaScript commands in your browser'/><author><name>Gilles</name><uri>http://www.blogger.com/profile/16133785183690600457</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjamcoYY5a25FIlZJwpeF29KU8CqHzmtLW8tBuHbjHelKhdRTlsNwjeC8FY5RaF6d6EZhwRaY4qM3ULykphccHT4W5yN5fpLLfetViuCczZ-x11oca06rMZiVfH_XJEBefpWzEBVD8pMfEw/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5774589090677396256.post-7092714002800619481</id><published>2011-02-28T08:00:00.000-08:00</published><updated>2011-02-28T12:16:56.953-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Command line"/><category scheme="http://www.blogger.com/atom/ns#" term="Tips"/><title type='text'>Tips: Manage your server expiration rules using the &#39;net accounts&#39; command</title><content type='html'>&lt;span style=&quot;color: #666666;&quot;&gt;&amp;lt;babblings&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #666666;&quot;&gt;The default security on a server is to force all users to change their passwords after 42 days.&lt;br /&gt;
Well.. This may be a good rule for important servers, but this can be really annoying for test servers, shared accounts, or any account you use once upon a time..&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #666666;&quot;&gt;&lt;br /&gt;
The most common way to modify this behavior is to use the local policy security console (through &quot;&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;gpedit.msc&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: x-small;&quot;&gt;&quot;&lt;/span&gt;&amp;nbsp;for example), finding the parameters, and modifying them.&lt;br /&gt;
Easy?&lt;br /&gt;
Well.. not so much if we look at all the people that struggles with doing that.&lt;br /&gt;
&lt;br /&gt;
In fact if like me you don&#39;t change those parameters very often, you will probably not remember where they are located.&lt;br /&gt;
And even after having found them, you might have some bad surprises when trying to modify them: &quot;Hey, I am the administrator, but the field is readonly! wtf..&quot;&lt;br /&gt;
&lt;br /&gt;
Well, a very easier and faster solution exists to perform this.&lt;br /&gt;
There are some really basics but still powerfull commands: the &quot;net commands&quot;.&lt;br /&gt;
Good administrators have been using them for ages!&lt;br /&gt;
&amp;lt;/babblings&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&quot;net accounts&quot; offers the following options:&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgepPhwtEtJdCQX0KdUsQT9c3JOExcaevfuW_6Ka2BAcoInjt4cpnjpicGmC_H4eqpAZrvbjz00_NaeWgk2HkK5-1XhTPXg3dLJZT-1pwNZYP-3Xrg12IC10v__3kmlcn8Wd_7H54kiUd_w/s1600/NetAccounts.Help.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgepPhwtEtJdCQX0KdUsQT9c3JOExcaevfuW_6Ka2BAcoInjt4cpnjpicGmC_H4eqpAZrvbjz00_NaeWgk2HkK5-1XhTPXg3dLJZT-1pwNZYP-3Xrg12IC10v__3kmlcn8Wd_7H54kiUd_w/s1600/NetAccounts.Help.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td alt=&quot;net accounts parameters&quot; class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&quot;net accounts&quot; parameters&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
Here is the &lt;a href=&quot;http://technet.microsoft.com/en-us/library/bb490698.aspx&quot;&gt;Microsoft Technet description&lt;/a&gt; of the parameters:&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: #274e13; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;/forcelogoff:&lt;/span&gt;{minutes | no}&amp;nbsp;-&lt;/strong&gt; &lt;em&gt;Sets the number of minutes to wait before ending a user&#39;s session with a server when the user account or valid logon time expires. The default value, no, prevents users from being forced to log off. &lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: #274e13; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;/minpwlen:&lt;/span&gt;length&lt;/strong&gt;&amp;nbsp;- &lt;em&gt;Sets the minimum number of characters for a user account password. The range is from 0 through 127 characters and the default is six characters. &lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: #274e13; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;/maxpwage:&lt;/span&gt;{days | unlimited}&lt;/strong&gt;&amp;nbsp;- &lt;em&gt;Sets the maximum number of days that a user account&#39;s password is valid. The unlimited value sets no maximum time. The /maxpwage command-line option must be greater than /minpwage. The range is from 1 through 49,710 days (that is, unlimited equals 49,710 days), and the default value is 90 days. &lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: #274e13; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;/minpwage:&lt;/span&gt;days&lt;/strong&gt;&amp;nbsp;- &lt;em&gt;Sets the minimum number of days before a user can change a new password. The default value is zero days, which sets no minimum time. The range is from 0 through 49,710 days. &lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: #274e13; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;/uniquepw:&lt;/span&gt;number&lt;/strong&gt;&amp;nbsp;- &lt;em&gt;Requires a user to not repeat the same password for the specified number of password changes. The range is from 0 through 24 password changes, and the default is five password changes. &lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: #274e13; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;/domain&lt;/span&gt;&lt;/strong&gt;&amp;nbsp;- &lt;em&gt;Performs the operation on the primary domain controller of the current domain. Otherwise, the operation is performed on the local computer. &lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
The 2 commands I use the most:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: &#39;Times New Roman&#39;; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;net accounts /maxpwage:unlimited&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: &#39;Times New Roman&#39;; font-size: small; font-weight: normal;&quot;&gt;&amp;nbsp; [to disable the expiration of the password]&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;net accounts /uniquepw:0&lt;/b&gt;&lt;/span&gt;&amp;nbsp; [to allow to reuse the same password]&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;Here is the default parameters on a new windows server 2008 R2 SP1:&lt;/div&gt;&lt;div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu821QFIg4D0OKy3BSsqKRULNoMzSB9-DBeP8LjpPA-nb9-8ET2NzHE3M8P3GkUe76w4aHB89YJvNp5-R7e_G1AiJTaL_Yxrny1bDG9gJOMGBUtGgQLgd-n8VXCGKIqPK_KyOQtzyRhjSu/s1600/NetAccounts.Default.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu821QFIg4D0OKy3BSsqKRULNoMzSB9-DBeP8LjpPA-nb9-8ET2NzHE3M8P3GkUe76w4aHB89YJvNp5-R7e_G1AiJTaL_Yxrny1bDG9gJOMGBUtGgQLgd-n8VXCGKIqPK_KyOQtzyRhjSu/s1600/NetAccounts.Default.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Default parameters on a new Windows Server 2008 R2 SP1&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;As you can see here, the values are not the &quot;default&quot; ones that are given in the Technet link above.&lt;br /&gt;
Here the passwords will expire after 42 days, and there is no history maintained [it signifies that you can redefine a password used previously].&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Here is the result after applying my&amp;nbsp;modifications:&lt;/div&gt;&lt;div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh37Y2eJBk7LDWPSay4_lsDA6QEqTgO4YqFHo-N8mWq0KEiX39vUIqYOZKXxM_pv7n9_acZV1Bc4AFB4smEuo986dGm02ls_mJsPbCbWwp__NYy4f4v0j_i3rarbcAUZPOeSGovrEB5_ldq/s1600/NetAccounts.NoExpiration.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh37Y2eJBk7LDWPSay4_lsDA6QEqTgO4YqFHo-N8mWq0KEiX39vUIqYOZKXxM_pv7n9_acZV1Bc4AFB4smEuo986dGm02ls_mJsPbCbWwp__NYy4f4v0j_i3rarbcAUZPOeSGovrEB5_ldq/s1600/NetAccounts.NoExpiration.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Expiration has been disabled&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;That&#39;s it!!&lt;br /&gt;
In a nutshell, to disable the expiration rule of the passwords, you only need to use this command: &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: &#39;Times New Roman&#39;; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;net accounts /maxpwage:unlimited&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&quot; ! ☺&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gillesperon.blogspot.com/feeds/7092714002800619481/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gillesperon.blogspot.com/2011/02/tips-manage-your-server-expiration.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5774589090677396256/posts/default/7092714002800619481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5774589090677396256/posts/default/7092714002800619481'/><link rel='alternate' type='text/html' href='http://gillesperon.blogspot.com/2011/02/tips-manage-your-server-expiration.html' title='Tips: Manage your server expiration rules using the &#39;net accounts&#39; command'/><author><name>Gilles</name><uri>http://www.blogger.com/profile/16133785183690600457</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgepPhwtEtJdCQX0KdUsQT9c3JOExcaevfuW_6Ka2BAcoInjt4cpnjpicGmC_H4eqpAZrvbjz00_NaeWgk2HkK5-1XhTPXg3dLJZT-1pwNZYP-3Xrg12IC10v__3kmlcn8Wd_7H54kiUd_w/s72-c/NetAccounts.Help.png" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5774589090677396256.post-5775562020155372241</id><published>2010-12-29T08:00:00.000-08:00</published><updated>2010-12-29T08:00:04.583-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Command line"/><category scheme="http://www.blogger.com/atom/ns#" term="Tips"/><title type='text'>Tips: The “clip” command</title><content type='html'>The “clip” command allows to redirect an output to the clipboard.&lt;br /&gt;
&lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq1GcAR9CTEprGyueTh1NyqHv3HyH_VJahU5MHwRw4DRAYG2m8euzGySlUDRmmUTVp809Pc1EB2crKM_dWg2C-ASV69FVUHBdtuh5ens75AYxrMJcddN9L8h8gatgHF4T-0ePpEMckEQmx/s1600-h/Clip01.ClipCommand%5B16%5D.png&quot;&gt;&lt;img alt=&quot;Clip01.ClipCommand&quot; border=&quot;0&quot; height=&quot;269&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_4RsWbi-ZRSo2vExC5AQGSzy_91Kc63p5opaV2hZdMNwvjBSsKu0pk74L4LKhVDg2M50YmhQrMuY122skRkX-c8z_1kg6ER0kGlPpG9QvW5YyJuRsJu_zprNO2fuYuAnbrSKxHfFIoYUG/?imgmax=800&quot; style=&quot;background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;Clip01.ClipCommand&quot; width=&quot;572&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
It can be very useful to copy the content of a large output in the clipboard.&lt;br /&gt;
&lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; style=&quot;height: 65px; text-align: center; width: 542px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot; width=&quot;498&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;For example, if you want to get all the assemblies that are in your GAC and whose name contains “TeamFoundation”:&lt;br /&gt;
&lt;span style=&quot;color: navy; font-family: Consolas;&quot;&gt;&lt;strong&gt;gacutil /l | find &quot;TeamFoundation&quot; | clip&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;﻿&lt;/div&gt;I sometimes use this command to avoid having to remember some complicated passwords.&lt;br /&gt;
&lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; style=&quot;height: 1117px; text-align: center; width: 542px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot; width=&quot;500&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;For example, if I have an exe “&lt;span style=&quot;color: navy; font-family: Consolas;&quot;&gt;&lt;strong&gt;%ProgramFiles%\MyProgram.exe&lt;/strong&gt;&lt;/span&gt;” that will prompt me for a password &quot;&lt;strong&gt;&lt;span style=&quot;color: navy; font-family: Consolas;&quot;&gt;MyComplicatedPassword&lt;/span&gt;&lt;/strong&gt;”, I will create the following shortcut:&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;color: navy; font-family: Consolas;&quot;&gt;%windir%\System32\cmd.exe /c &quot;(echo MyComplicatedPassword| clip) &amp;amp; (&quot;%ProgramFiles%\MyProgram.exe&quot;)&quot;&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;strong&gt;&lt;u&gt;Main steps for this creation:&lt;/u&gt;&lt;/strong&gt;&lt;/div&gt;﻿﻿ &lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOdm0dJiaeUyGGEvtp9Ic3w2LX2-q2A1ghNl5Zp5VZ8get1Vopo328YydYhUNJsmWiUUZPn-p4eWv9KE7fgb6S7vYuo2PyQzpjc1qcmrtywwdEGcNzI4qFrVxHmfS4p0DzbKN4oPKWC0AI/s1600-h/Clip02.NewLink%5B3%5D.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Clip02.NewLink&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuLJa4VT_TS3A5gEbBYDErl-7NSnCfNhr8dsv-f5AsUmV5objKxgzQithIcFJhMKIZCMLiacAreX8X4pzHNKaCy2poxFb-rs8NzzHs2mJRvfZbWzTYPsWRX-xsxurPH5PS0q3VSFtVhBZS/?imgmax=800&quot; style=&quot;background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;Clip02.NewLink&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Create a new shortcut&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;﻿﻿﻿﻿﻿﻿﻿﻿ &lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSbOZF8ZSFVzMch5CO0mbHfwRJzQkQd64UJ08i6OlYO1LONuI-qm0aLZO71vnFSaNFFcvUWS3qAtjwP4VBP9RYR4WKyqWG4D5dJ_smI4_d3Vs6cc2FHLuYhyphenhyphenXHSJ9kg4ufNc8gHPJozNUP/s1600-h/Clip03.NewLinkCommand%5B3%5D.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Clip03.NewLinkCommand&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDMGK0oFdnaIsPmLPbwnR3EvgdQ7Ixybjqx8s6eoU5mkLu1jA9-elQzyrTSs82PDq6XSnh5pHYaDYFo_6QSXz6RHGOaCvSK5kyOAd7ZS4kBcAsnAJFTLVBDOj2vODngXgt8r5J3645WoLg/?imgmax=800&quot; style=&quot;background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;Clip03.NewLinkCommand&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Set up the command&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;﻿﻿﻿﻿﻿﻿ &lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;Now when I will use my new shortcut, it will launch my application, and when I will be prompted for its password, I will be able to paste it!&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Observations:&lt;/u&gt;&lt;/strong&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Write “&lt;strong&gt;&lt;span style=&quot;color: navy; font-family: Consolas;&quot;&gt;echo MyComplicatedPassword| clip&lt;/span&gt;&lt;/strong&gt;”, and not “&lt;strong&gt;&lt;span style=&quot;color: navy; font-family: Consolas;&quot;&gt;echo MyComplicatedPassword | clip&lt;/span&gt;&lt;/strong&gt;” to avoid to include a space character at the end of the password,&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;text-align: left;&quot;&gt;A shortcut must point on an existent file. Hence the use of “&lt;strong&gt;&lt;span style=&quot;color: navy; font-family: Consolas;&quot;&gt;%windir%\System32\cmd.exe&lt;/span&gt;&lt;/strong&gt;”.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Some applications are expecting to be launched from their folder. You might need to set up the “&lt;strong&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;Start in&lt;/span&gt;&lt;/strong&gt;” value in the properties of your new link (well.. and while you are having a look to the properties, you may also want to play with “&lt;strong&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;Change Icon…&lt;/span&gt;&lt;/strong&gt;”, and to set the “&lt;span style=&quot;font-family: Consolas;&quot;&gt;&lt;strong&gt;Run&lt;/strong&gt;&lt;/span&gt;” value to “&lt;strong&gt;&lt;span style=&quot;font-family: Consolas;&quot;&gt;Minimized&lt;/span&gt;&lt;/strong&gt;”)&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;ul&gt;&lt;/ul&gt;﻿ &lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggBbOscZlyBmCsdSlHPUx-9MCSFIkezWowWw2u7pI9s1K3jgz96TE0P_EyYM81LSMNyPTp3eDWCTlnjaYkiPIgHvN35x0gez5h8d0WJJozuluNFPfMlgagDon067XUjfOdfPiXoyMrtpQE/s1600-h/Clip04.NewLinkProperties%5B3%5D.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Clip04.NewLinkProperties&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT6pL1y7cLeqqTBL1eT2L4FocZrMLqsM7oLEjeNGBLqfe8REqPplnce0UHMWhOy_hTa85jQCvPKW3rKBtpiC5tgesjlWdEjWzwphYbMIjhfXT0ek14GQmGs-fzWx_QFtzKxY-WcBaAtlr5/?imgmax=800&quot; style=&quot;background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;Clip04.NewLinkProperties&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Improve your new shortcut&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;ul&gt;&lt;li&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Don’t do that with important passwords &lt;img alt=&quot;Eye rolling smile&quot; class=&quot;wlEmoticon wlEmoticon-eyerollingsmile&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjT875eG1WXAv45hWqt0H0D7UPs6qkZkGZnek6Pkjsg02dzJ7VdIZ4NDWGxTgD_m8DjF_AG5rK9zW-DrZJwE8ZtQ5yeTzYQM7Rm1epu7hxbppKZjBRtZEPy1iPmiUL-sphjOh0eUppyyFIA/?imgmax=800&quot; style=&quot;border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none;&quot; /&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gillesperon.blogspot.com/feeds/5775562020155372241/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gillesperon.blogspot.com/2010/12/tips-clip-command.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5774589090677396256/posts/default/5775562020155372241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5774589090677396256/posts/default/5775562020155372241'/><link rel='alternate' type='text/html' href='http://gillesperon.blogspot.com/2010/12/tips-clip-command.html' title='Tips: The “clip” command'/><author><name>Gilles</name><uri>http://www.blogger.com/profile/16133785183690600457</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_4RsWbi-ZRSo2vExC5AQGSzy_91Kc63p5opaV2hZdMNwvjBSsKu0pk74L4LKhVDg2M50YmhQrMuY122skRkX-c8z_1kg6ER0kGlPpG9QvW5YyJuRsJu_zprNO2fuYuAnbrSKxHfFIoYUG/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5774589090677396256.post-1998908942726954856</id><published>2010-11-04T07:06:00.000-07:00</published><updated>2010-11-04T13:44:01.565-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Command line"/><category scheme="http://www.blogger.com/atom/ns#" term="Scripting"/><category scheme="http://www.blogger.com/atom/ns#" term="Tips"/><title type='text'>Let&#39;s talk about batch and command line scripting - Part 1/2</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;lt;Babblings&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;About this article&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;There are lots of powerful tools to perform scripting.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;Powershell is great to manipulate files, MSBuild is nice to create tasks and execute them, ..&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;However to perform quick tasks on any Windows, batch scripting can be quite handy:&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;it is always available [no need to install anything],&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;when you are used to the syntax, it is quite easy and fast,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;you can write a .bat file and then execute it on any Windows&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;Even if now powershell can be found almost anywhere, you cannot execute scripts by default on it.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;[And having to modify a register, or to be an administrator to launch &quot;set-ExecutionPolicy RemoteSigned&quot;, can be annoying when the goal is to perform quickly a few actions, or when you expect a script to be run on several computers]&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;I will not present in this article all the commands that are available, but I will focus on the scripting part.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;I will not explain the use of basic commands or keywords, like &quot;@echo off&quot;, &quot;REM&quot;, &quot;SET&quot;... If you have never written a script, or at least read one, this article is probably not the best one to start...&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;To get a list of the main commands, you can type &quot;Help&quot; in a Command Prompt.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;To get more information, you can have a look here:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;a href=&quot;http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx&quot;&gt;http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;By the way, each time you will see a section like this one (&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&amp;lt;Babblings&amp;gt;..&amp;lt;/Babblings&amp;gt;&lt;/span&gt;&lt;/span&gt;)... You can skip it! This is just me babbling. No crucial information here.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;lt;/Babblings&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #274e13;&quot;&gt;1. Using the round brackets ( ) to create blocks&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;To define&amp;nbsp;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;blocks of commands&lt;/span&gt;&lt;/b&gt;, you need to use the round brackets.&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;For example to write a &#39;if&#39; statement with several commands, you can write:&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;if &quot;%toto%&quot; == &quot;Test&quot; (&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;&amp;nbsp;&amp;nbsp; echo 1st line&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;&amp;nbsp;&amp;nbsp; echo 2nd line&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;2. Using ^ to create multi-lines commands&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;^ allows to define&amp;nbsp;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;multi-lines commands&lt;/span&gt;&lt;/b&gt;. It can really be convenient to improve the readability of a script.&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;For example:&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;echo This test ^&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;will write^&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;a unique line.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;returns:&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;This test will write a unique line.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;3. Using &amp;amp; to write several commands on a line&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;amp; does the opposite of ^&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;It allows to write&amp;nbsp;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;several commands on a line&lt;/span&gt;&lt;/b&gt;.&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;For example:&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;echo 1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;echo 2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;can be written:&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;echo 1 &amp;amp; echo 2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;However, to improve the readability, I prefer writing:&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;(echo 1) &amp;amp; (echo 2)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;lt;Babblings&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;I already spoke twice of readability:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;when you write a script, always keep in mind that someone may need to read it after...&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;Worst case scenario: this someone can be you in a very long time!!!&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;(Yes, sometimes I have to think hard to figure what past-me has written. But I made a deal with future-me to improve that.)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;lt;/Babblings&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #666666; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;4. Block statements&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;4.1. The &#39;if&#39; statement&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;The 3 most usual ways to use &#39;if&#39; are:&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Checking if a file exists: &amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;if [not] &lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;exist &lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;FileName (command1) [else (command2)]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Checking if a variable exists: &amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;if &lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;defined &lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;variable (command1) [else (command2)]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Comparing elements:&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;Basic way:&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;if [not] string1==string2 (command1) [else (command2)]&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;Advanced:&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;if [/i] string1 CompareOp string2 (command1) [else (command2)]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;where&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;/i&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt; indicates that the comparison must be case insensitive&lt;/li&gt;
&lt;li&gt;if &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;string1 &lt;/span&gt;&lt;/span&gt;and &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;string2 &lt;/span&gt;&lt;/span&gt;contains only digits, a numeric comparison is performed&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;CompareOp&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;is a&amp;nbsp;three-letter comparison operator:&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;EQU for &#39;=&#39;, NEQ for &#39;≠&#39;,&lt;/li&gt;
&lt;li&gt;LSS for &#39;&amp;lt;&#39;, LEQ for &#39;≤&#39;,&lt;/li&gt;
&lt;li&gt;GTR for &#39;&amp;gt;&#39;, GEQ for &#39;≥&#39;&lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;Therefore:&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;if /i &quot;2&quot; GTR &quot;10&quot; (echo String comparison) else (echo Numeric comparison)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;returns &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;String comparison&lt;/span&gt;&lt;/span&gt;&quot;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;while&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;if /i 2 GTR 10 (echo String comparison) else (echo Numeric comparison)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;returns &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;Numeric comparison&lt;/span&gt;&lt;/span&gt;&quot;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;To get more options:&amp;nbsp;&lt;a href=&quot;http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/if.mspx&quot;&gt;http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/if.mspx&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;4.2. The &#39;for&#39; statement&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;When it has been created, this command was intended to be used on a set of files. But it can now be quite useful to perform loops.&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
The default syntax is:&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #134f5c;&quot;&gt;for [variable] in (set) do (command)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;where&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;[variable]&lt;/span&gt;&lt;/span&gt; must be &#39;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;%&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&#39; followed by &lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;one &lt;/span&gt;&lt;/b&gt;case sensitive letter when &#39;for&#39; is used &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;b&gt;from the command line&lt;/b&gt;&lt;/span&gt;,&amp;nbsp;or &#39;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;%&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;%&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&#39;, also followed by&amp;nbsp;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;one&amp;nbsp;&lt;/span&gt;&lt;/b&gt;case sensitive letter when it is used&amp;nbsp;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;from&amp;nbsp;&lt;/b&gt;&lt;/span&gt;a script&lt;/span&gt;&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;(set)&lt;/span&gt;&lt;/span&gt; can be a file mask, like &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;(*.doc *.txt)&lt;/span&gt;&lt;/span&gt;&quot;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;For example the following script (take care of the &#39;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;%%&lt;/span&gt;&#39;) opens&amp;nbsp;in different notepads all&amp;nbsp;the .txt and .bat files:&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;for %%f in (*.txt *.bat) do start notepad.exe %%f&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;Several other options exist on the &#39;for&#39; command.&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;The one I find the most interesting is &#39;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;/L&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&#39; (L for &lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;Loop&lt;/span&gt;&lt;/b&gt;).&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
For example here is an&amp;nbsp;enumeration, starting from 0, ending at 10, by step of 1:&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;for /L %%i in (0,1,10) do echo %%i&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
While the following script creates an infinite loop:&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;for /L %%i in (0,0,0) do echo To infinity and beyond!&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
You can check all the possibilities here:&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;a href=&quot;http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/for.mspx&quot;&gt;http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/for.mspx&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;lt;Babblings&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;It took me some time to remember the syntax of the &#39;for&#39; command.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;And very often I still forget that the variable must be in the format &#39;%v&#39; or &#39;%%v&#39;, depending on where is used the command.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;However, this is quite a useful command to know.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;lt;/Babblings&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;5. Using &amp;amp;&amp;amp; and ||&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;Here come 2 boolean operators that deserve to be known!&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;I think an example will explain how to use them:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;(MyTestCommand) &amp;amp;&amp;amp; (echo success) || (echo failed)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;is equivalent to&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;MyTestCommand&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;if %ERRORLEVEL% == 0 (echo success) else (echo failed)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;or&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;(MyTestCommand) &amp;amp; (if %ERRORLEVEL% == 0 (echo success) else (echo failed))&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;2 other examples:&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;(ping -n 1 127.0.0.1 &amp;gt; nul) &amp;amp;&amp;amp; (echo Success) || (echo Failed)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;returns &#39;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;Success&lt;/span&gt;&lt;/span&gt;&#39;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;while&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;(ping -n 1 1.0.0.0 &amp;gt; nul) &amp;amp;&amp;amp; (echo Success) || (echo Failed)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;returns &#39;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;Failed&lt;/span&gt;&lt;/span&gt;&#39; (assuming that you can&#39;t reach 1.0.0.0 on your network)&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #666666;&quot;&gt;&amp;lt;Babblings&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #666666;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #666666;&quot;&gt;I really use a lot &#39;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&#39; and &#39;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;||&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #666666;&quot;&gt;&#39;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #666666;&quot;&gt;I think &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;(MyCommand) || (MyOtherCommand)&lt;/span&gt;&quot;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #666666;&quot;&gt;is more readable than&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #666666;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;MyCommand&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #666666;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;IF not %ERRORLEVEL% == 0 (MyOtherCommand)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #666666;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #666666;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #666666;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #666666;&quot;&gt;&amp;lt;/Babblings&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;6. Using labels&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;In batch files, labels are used by:&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&#39;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;goto&lt;/span&gt;&#39;: to jump in another place in the code (without parameters),&lt;/li&gt;
&lt;li&gt;&#39;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;call&lt;/span&gt;&#39;: to call a function and then to continue the current execution of the script (some parameters can be specified)&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;The definition of a label must start by &#39;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;:&lt;/span&gt;&#39;, but this&amp;nbsp;character can be omitted in the &#39;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;goto&lt;/span&gt;&#39; or the &#39;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;call&lt;/span&gt;&#39;.&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;The script:&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;echo 1&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;goto &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;:Jump This is a test&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;echo 2&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;echo 3&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;:Jump&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;echo 4 - %*&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;echo 5&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
will return&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;4 - &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;[either nothing, either the parameters provided to the script. Here &quot;This is a test&quot; is useless and ignored]&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;5&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;whereas the script:&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;echo 1&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;call&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;:Jump This is a test&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;echo 2&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;echo 3&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;:Jump&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;echo 4 - %*&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;echo 5&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
will return&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;4 - This is a test&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;5&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;3&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;4 -&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;[either nothing, either the parameters provided to the script.]&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;5&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;Observation:&lt;br /&gt;
You can jump directly to the&amp;nbsp;end of the script by using:&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;goto :EOF&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&#39;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0c343d;&quot;&gt;goto :EOF&lt;/span&gt;&lt;/span&gt;&#39; is usually used at the end of a function (because the function will returned only after having reached its end)&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;Conclusion of this first part&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;lt;Babblings&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;I did not put here all what I had intended. Therefore next Thursday I will write a 2nd part.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;This is my first real post, so excuse the way the codes are written: I will improve my blog progressively&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;lt;/Babblings&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
In the next part of this article, I will explain:&lt;/div&gt;&lt;ul&gt;&lt;li&gt;How to call a script and how to exit it,&lt;/li&gt;
&lt;li&gt;How to manage strings,&lt;/li&gt;
&lt;li&gt;The usual problem of &quot;Variable expansion&quot; (what is it and how to manage it),&lt;/li&gt;
&lt;li&gt;A few comments/tips on interesting commands,&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;To end this first post, I think this video fits well:&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;a href=&quot;http://www.youtube.com/watch?v=dmEvPZUdAVI&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;http://www.youtube.com/watch?v=dmEvPZUdAVI&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;object height=&quot;385&quot; width=&quot;480&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/dmEvPZUdAVI?fs=1&amp;amp;hl=en_US&amp;amp;color1=0x234900&amp;amp;color2=0x4e9e00&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/dmEvPZUdAVI?fs=1&amp;amp;hl=en_US&amp;amp;color1=0x234900&amp;amp;color2=0x4e9e00&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;480&quot; height=&quot;385&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Thank you for reading!&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;G.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gillesperon.blogspot.com/feeds/1998908942726954856/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gillesperon.blogspot.com/2010/11/lets-talk-about-batch-and-command-line.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5774589090677396256/posts/default/1998908942726954856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5774589090677396256/posts/default/1998908942726954856'/><link rel='alternate' type='text/html' href='http://gillesperon.blogspot.com/2010/11/lets-talk-about-batch-and-command-line.html' title='Let&#39;s talk about batch and command line scripting - Part 1/2'/><author><name>Gilles</name><uri>http://www.blogger.com/profile/16133785183690600457</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5774589090677396256.post-8067298396043038187</id><published>2010-11-01T07:06:00.000-07:00</published><updated>2010-11-06T02:42:25.467-07:00</updated><title type='text'>Hello World 2</title><content type='html'>&lt;span style=&quot;font-family: inherit;&quot;&gt;I have decided recently to start a technical blog.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;I am not sure I will keep it for long, but well... who knows.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;I will try to alternate here short articles [tips, comments on interesting books / tools, ...], and longer stuffs.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;This is my 2nd blog. I kept the 1st one from 2006 to 2008, but it was not very technical.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;This blog will be about Microsoft .Net, mostly with C#. I will probably write some things about Silverlight and WPF. Maybe Workflow Foundation. Certainly Team Foundation Server and some other useful tools. In short, this blog will be about developing on a Windows Platform with Microsoft .Net.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Ok. 1st message is written.&lt;br /&gt;
Interesting things might start next Thursday.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Stay tuned,&lt;br /&gt;
G&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://gillesperon.blogspot.com/feeds/8067298396043038187/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gillesperon.blogspot.com/2010/11/hello-world-2.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5774589090677396256/posts/default/8067298396043038187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5774589090677396256/posts/default/8067298396043038187'/><link rel='alternate' type='text/html' href='http://gillesperon.blogspot.com/2010/11/hello-world-2.html' title='Hello World 2'/><author><name>Gilles</name><uri>http://www.blogger.com/profile/16133785183690600457</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry></feed>