-2

This is the first time I am creating a batch file. I want to run a chess program using graphical interface. Creator of this program wrote:

Sunfish' can communicate through the XBoard/CECP protocol by the command pypy -u xboard.py.

So I am wondering how can I make this work. I thought of something like this:

@ECHO
C:\Users\username\AppData\Local\Programs\Python -u xboard.py
PAUSE

However it brings error:

C:\Users\username\AppData\Local\Programs\Python' is not recognized as an internal or external command, operable program or batch file.

Maybe somethins is wrong with the directory I gave? My python app is under this directory C:\Users\username\AppData\Local\Programs\Python\Python36\python.exe

Here is the link to chess program I want to run, under the run section it is written what I wrote here.

Mike Doe
  • 16,349
  • 11
  • 65
  • 88
szczor1
  • 191
  • 1
  • 2
  • 12

1 Answers1

2

Please do your research before asking a question. All of this information is easily available by just reading the 'Run it!' section of the 'README.md' and a quick Google search.


You need to point to the python.exe, because pointing to the directory alone isn't going to work.

However, it is recommended to run this with PyPy instead of Python (read more on installation). If you want to run it with Python anyway, have a look at this.

Also username alone is just a string, what you need is %UserName% which is the variable that contains the username:

C:\Users\%UserName%\AppData\Local\Programs\Python\Python36\python.exe -u xboard.py

Alternatively you can just use %LocalAppData% which is the same as C:\Users\%UserName%\AppData\Local:

%LocalAppData%\Programs\Python\Python36\python.exe -u xboard.py

There's a list with the environment path variables over at Super User.

FatalBulletHit
  • 762
  • 6
  • 22