{"id":97,"date":"2016-03-19T10:53:19","date_gmt":"2016-03-19T09:53:19","guid":{"rendered":"https:\/\/solidt.eu\/blog\/?p=97"},"modified":"2025-02-19T15:20:16","modified_gmt":"2025-02-19T14:20:16","slug":"using-a-batch-file-as-shortcut-or-cli-alias","status":"publish","type":"post","link":"https:\/\/solidt.eu\/site\/using-a-batch-file-as-shortcut-or-cli-alias\/","title":{"rendered":"A batch file as shortcut or CLI alias"},"content":{"rendered":"\n<p>Changing the directory to the directory of the script, and passing arguments. (In this case to the Lua interpreter)<br>It is possible to echo the full command before execution, and to pause when the command exits.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">@echo off\npushd \"%~dp0\"\nset MWD=%CD%\nset RUNCMD=\"%MWD%\\bin\\lua51.exe\" \"%MWD%\\lua\\index.lua\" \"%*\"\nREM echo %RUNCMD%\ncmd \/c \"%RUNCMD%\"\npopd\ntimeout \/T 5\nREM pause\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">A symlink (on windows)<\/h2>\n\n\n\n<p>Sometimes a better alternative:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">mklink \"C:\\bin\\my.exe\" \"C:\\Program Files\\My\\my.exe\"<\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Changing the directory to the directory of the script, and passing arguments. (In this case to the Lua interpreter)It is possible to echo the full command before execution, and to pause when the command exits. A symlink (on windows) Sometimes a better alternative:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[8],"tags":[],"class_list":["post-97","post","type-post","status-publish","format-standard","hentry","category-other-scripts"],"_links":{"self":[{"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/posts\/97","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/comments?post=97"}],"version-history":[{"count":7,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/posts\/97\/revisions"}],"predecessor-version":[{"id":9298,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/posts\/97\/revisions\/9298"}],"wp:attachment":[{"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/media?parent=97"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/categories?post=97"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/tags?post=97"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}