Quantcast
Channel: 簡睿隨筆
Viewing all articles
Browse latest Browse all 897

Nyagos開啟控制台檔案的方法

$
0
0

先前在打破Windows與UNIX的藩籬:nyagos-介於UNIX跟DOS之間的混血的CommandLine Shell裡提到解決開啟控制台檔案的方法是使用批次檔,如:

@echo off
if "%1"=="net" ncpa.cpl
if "%1"=="fire" Firewall.cpl
if not "%1"=="" %1.cpl
if "%1"=="" dir /w c:\windows\system32\*.cpl

再額外設定alias以快速開啟:

nyagos.alias["appwiz.cpl"]="cpl appwiz"

但這個方法必須手動設定要使用的檔名,有點麻煩,不如直接修改 nyagos.d/suffix.lua

  • cmd /c來開啟控制台命令
  • open開啟.msc檔案
for key,val in pairs{
    awk={"gawk","-f"},
    js={"cscript","//nologo"},
    lua={"nyagos.exe","--norc","--lua-file"},
    pl={"perl"},
    ps1={"powershell","-ExecutionPolicy","RemoteSigned","-file"},
    rb={"ruby"},
    vbs={"cscript","//nologo"},
    wsf={"cscript","//nologo"},
    py={"python"},
    cpl={"cmd.exe", "/c"},
    msc={"open"},
} do
    share._setsuffix( key , val )
end

##

您可能也會有興趣的類似文章


Viewing all articles
Browse latest Browse all 897

Trending Articles