I'm so lazy - [ghost one click start button script]


#1

Is there some way - like bat file or smth that would automatically
cd to my ghost folder, then just run ghost start and open http://localhost:2368
all that just by me clicking on it?

I hate command prompt -.-


#2

Well, You said you are lazy that’s why I have spent some time and manadged to make something working for you.

Add the following code in .bat file and save that file. double click that file.

I assume you have your ghost folder in C: driver. In case not. Change the second line C:\ghost with your ghost folder path.

@ECHO off
CD /D C:\ghost
CMD /C "ghost start"
start /wait http://localhost:2368/

ECHO.
ECHO Do you want to restart or stop Ghost?

:choice
ECHO.
set /P c=[ enter R=restart / S=Stop ]?
if /I "%c%" EQU "R" goto :restart
if /I "%c%" EQU "S" goto :stop
goto :choice

:restart
CMD /C "ghost restart"
goto :choice

:stop
CMD /C "ghost stop" 
exit

GIST: https://gist.github.com/biswajit-saha/9d44cfc5769f2dc236683651bf3a5adb


#3

excellent! Thanks a lot. :smile:
may long live one click solutions :smile:

This should come with every installation. LOL


#4

That’s bit crazy :smiley: anyway I am glad that it helped you.


#5

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.