{"id":108,"date":"2009-07-24T01:40:27","date_gmt":"2009-07-24T06:40:27","guid":{"rendered":"http:\/\/blog.buluschek.com\/?p=108"},"modified":"2023-07-02T10:49:24","modified_gmt":"2023-07-02T08:49:24","slug":"getting-the-location-of-an-executing-batch-script-bat-file","status":"publish","type":"post","link":"https:\/\/www.buluschek.com\/?p=108","title":{"rendered":"Getting the location of an executing batch script (.bat file)"},"content":{"rendered":"<p>A Windows batch script (.bat file) has an associated directory; the current working folder. It can be accessed in a batch file by the system variable <code>%cd%<\/code>. If instead, you want to obtain the location of the currently executing script, use <code>%~dp0<\/code>.<\/p>\n<p>Note that both may be the same, but are not necessarily.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A Windows batch script (.bat file) has an associated directory; the current working folder. It can be accessed in a batch file by the system variable %cd%. If instead, you want to obtain the location of the currently executing script, use %~dp0. Note that both may be the same, but are not necessarily.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-108","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.buluschek.com\/index.php?rest_route=\/wp\/v2\/posts\/108","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.buluschek.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.buluschek.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.buluschek.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.buluschek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=108"}],"version-history":[{"count":3,"href":"https:\/\/www.buluschek.com\/index.php?rest_route=\/wp\/v2\/posts\/108\/revisions"}],"predecessor-version":[{"id":111,"href":"https:\/\/www.buluschek.com\/index.php?rest_route=\/wp\/v2\/posts\/108\/revisions\/111"}],"wp:attachment":[{"href":"https:\/\/www.buluschek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.buluschek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.buluschek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}