How do I execute a love file in command prompt?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Ekamu
Party member
Posts: 178
Joined: Fri Sep 20, 2013 11:06 am

How do I execute a love file in command prompt?

Post by Ekamu »

So I'm using Windows 10.
I have a folder e.g TEST on drive C:
so its something like C:/Users/Ekamu/Desktop/TEST
I have a lnk to run love files. usually I would drag and drop.

in command prompt I can run the lnk with
love.lnk

and the no game runs (in same directory as my files)

I tried this in command prompt in windows 10
START love.lnk "TEST"
START "TEST" love.lnk

but the no game runs without executing the file. Is it specifically for .exe executables only? In Windows 8 I had no problems with executing files from command prompt with love.exe or love.lnk. Did they remove this feature?
User avatar
Roland Chastain
Prole
Posts: 34
Joined: Sat Feb 07, 2015 2:30 pm
Location: France
Contact:

Re: How do I execute a love file in command prompt?

Post by Roland Chastain »

Hello! It's very simple. For example:

Code: Select all

C:\Love\0.10.1\love.exe yourproject.love
or simply

Code: Select all

love.exe yourproject.love
if love.exe directory is in the PATH variable.

If your project is in a folder (and not a .love file), it's the same thing:

Code: Select all

love.exe yourproject
Ekamu
Party member
Posts: 178
Joined: Fri Sep 20, 2013 11:06 am

Re: How do I execute a love file in command prompt?

Post by Ekamu »

Thanks it only works for .exe and not for .lnk
User avatar
Roland Chastain
Prole
Posts: 34
Joined: Sat Feb 07, 2015 2:30 pm
Location: France
Contact:

Re: How do I execute a love file in command prompt?

Post by Roland Chastain »

Ekamu wrote:Thanks it only works for .exe and not for .lnk
But, if I may ask, why do you want to use a link in that case?

Another possibility is to use a command file, named (for example) love.cmd, with this line:

Code: Select all

C:\Love\0.10.1\love.exe %1
After that, you can drag and drop your project folder (or your .love file) on the command file, or call it in command prompt:

Code: Select all

love.cmd yourproject
or even

Code: Select all

love yourproject
This can be handy, for example, if you use different LÖVE versions.

Sorry if I didn't answered exactly your question. :)
User avatar
zorg
Party member
Posts: 3441
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: How do I execute a love file in command prompt?

Post by zorg »

I personally use a file called "run.bat", that's in all my folders, with the path to the executable in it, and it runs main.lua. simple.
For example:
"e:\Portable Programs\love-0.10.1-win64\love.exe" .\
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Post Reply

Who is online

Users browsing this forum: pgimeno and 100 guests