{"id":86,"date":"2010-10-08T15:45:23","date_gmt":"2010-10-08T21:45:23","guid":{"rendered":"http:\/\/zekesdominion.com\/?p=86"},"modified":"2013-08-08T20:37:32","modified_gmt":"2013-08-09T02:37:32","slug":"windows-command-escape-character","status":"publish","type":"post","link":"https:\/\/zekesdominion.com\/?p=86","title":{"rendered":"Windows command escape character"},"content":{"rendered":"<p>Apparently the escape character for cmd.exe is ^.<\/p>\n<p>So if you want to do the equivalent of <code>echo \"\\$PATH = $PATH\"<\/code> in Windows, you would do <code>echo \"^%PATH^%=%PATH%\"<\/code><\/p>\n<p>In PowerShell, things are a bit different. They decided to change the variable identifier to $, which is nice and consistent with unix. Still didn&#8217;t use the \\ character for escaping, though. The reason is that it overlaps with the path separator from DOS. So instead, you must use ` (back tick). Of course, this messes with me since in bash back tick is used to execute a command and return the output in to a variable.<\/p>\n<p>See:<br \/>\n<a href=\"http:\/\/thepursuitofalife.com\/escape-characters-in-windows-cmdexe\/\">CMD.EXE Escape characters<\/a><br \/>\n<a href=\"http:\/\/www.techotopia.com\/index.php\/Windows_PowerShell_1.0_String_Quoting_and_Escape_Sequences\">PowerShell Escape Sequences<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apparently the escape character for cmd.exe is ^. So if you want to do the equivalent of echo &#8220;\\$PATH = $PATH&#8221; in Windows, you would do echo &#8220;^%PATH^%=%PATH%&#8221; In PowerShell, things are a bit different. They decided to change the variable identifier to $, which is nice and consistent with unix. Still didn&#8217;t use the [&#038;hellip<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[8],"tags":[],"class_list":["post-86","post","type-post","status-publish","format-standard","hentry","category-tips"],"_links":{"self":[{"href":"https:\/\/zekesdominion.com\/index.php?rest_route=\/wp\/v2\/posts\/86","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zekesdominion.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zekesdominion.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zekesdominion.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/zekesdominion.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=86"}],"version-history":[{"count":5,"href":"https:\/\/zekesdominion.com\/index.php?rest_route=\/wp\/v2\/posts\/86\/revisions"}],"predecessor-version":[{"id":114,"href":"https:\/\/zekesdominion.com\/index.php?rest_route=\/wp\/v2\/posts\/86\/revisions\/114"}],"wp:attachment":[{"href":"https:\/\/zekesdominion.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=86"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zekesdominion.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=86"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zekesdominion.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=86"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}