【问题标题】:python is not recognized as an internal or external command while running batch file运行批处理文件时,python 未被识别为内部或外部命令
【发布时间】:2018-03-02 08:08:55
【问题描述】:

我为 python 设置了环境变量,如果我不在批处理文件中接受用户输入,我可以运行 python。但如果我接受用户输入,我将无法在批处理文件中运行 python 脚本。

@echo off
set /p Path="Enter Folder path in which all the timestamp files are stored: "

echo %path%

:: this is to read ip address from report folder to ipaddress.txt
dir %Path% /b /a-d > ipaddress.txt

echo %cd%

python trial.py

【问题讨论】:

    标签: python-2.7 batch-file


    【解决方案1】:

    选择path以外的变量名。

    path 是一个保留名称,其中包含用于搜索可执行文件的目录列表 - 例如 python.exe

    【讨论】:

      猜你喜欢
      • 2015-12-30
      • 2018-07-08
      • 1970-01-01
      • 2014-10-14
      • 2021-03-09
      • 2016-07-29
      • 1970-01-01
      • 2014-10-19
      相关资源
      最近更新 更多