1

I am trying to run a python script from a windows batch file.

My batch file is

@echo OFF

python C:\work\a.py

it works for me. But when I do it like this

@echo OFF

set fi = C:\work\a.py
python %fi%

it opens the python console.

New Pagodi
  • 3,484
  • 1
  • 14
  • 24
ish
  • 11
  • 2
  • That is not the proper syntax for the `SET` command. Open up a command prompt and type: `set /?` to read the usage. It does not show any spaces before or after the equals symbol. – Squashman Nov 03 '18 at 14:20
  • You have created the variable `%fi%`, with the value `C:\work\a.py`! You should use, `Set "fi=C:\work\a.py"` – Compo Nov 03 '18 at 14:25
  • Possible duplicate of [Why is no string output with 'echo %var%' after using 'set var = text' on command line?](https://stackoverflow.com/questions/26386697/why-is-no-string-output-with-echo-var-after-using-set-var-text-on-comman) – DavidPostill Nov 04 '18 at 13:47

0 Answers0