lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 9 May 2012 02:08, Egor Skriptunoff <egor.skriptunoff@gmail.com> wrote:
> Impressing results!
>
> One more problem should be solved.  User can enter command line
> manually (hello one two three) or can simply double click on the file
> and full filespec will be placed into command line
> ("C:\path\hello.bat").  Both cases should be properly handled.
>
> ::Lua:: --[[
> if exist %0.bat lua52.exe %0.bat %* && exit /b
> lua52.exe %0 %* && exit /b
> ]]
> print 'This is Lua script'

Much better is using %~nx0
lua52.exe %~nx0 %*