命令行在计划时确实有效 [英] Command-line does work when scheduled

查看:47
本文介绍了命令行在计划时确实有效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我想安排一个Python程序来读取

输入的命令行。但是,当在命令行中添加一个参数时,Python

在使用Windows计划任务时将无法获取它。


如何让它工作?


谢谢,

Jim

Hi,

I want to schedule a Python program that reads the command line for
input. However, when adding an argument to the command line Python
will not pick it up when using Windows scheduled tasks.

How do I get it to work?

Thanks,
Jim

推荐答案

En Sat ,2007年9月29日17:34:34 -0300,Jim< js ****** @ compuserve.comescribi ???:
En Sat, 29 Sep 2007 17:34:34 -0300, Jim <js******@compuserve.comescribi???:

我想安排一个Python程序,它读取

输入的命令行。但是,当在命令行中添加一个参数时,Python

在使用Windows计划任务时将无法获取它。


如何让它工作?
I want to schedule a Python program that reads the command line for
input. However, when adding an argument to the command line Python
will not pick it up when using Windows scheduled tasks.

How do I get it to work?



定义任务时是否编写命令行?使用双引号

围绕带空格的参数?

它适用于我。


-

Gabriel Genellina

Do you write the command line when defining the task? Using double quotes
around arguments with spaces?
It works fine for me.

--
Gabriel Genellina


9月29日下午3:19,Gabriel Genellina < gagsl -... @ yahoo.com.ar>

写道:
On Sep 29, 3:19 pm, "Gabriel Genellina" <gagsl-...@yahoo.com.ar>
wrote:

En Sat,2007年9月29日17:34: 34 -0300,Jim< jscre ... @compuserve.comescribi?:
En Sat, 29 Sep 2007 17:34:34 -0300, Jim <jscre...@compuserve.comescribi?:

我想安排一个读取命令行的Python程序

输入。但是,当在命令行中添加参数时,Python

在使用Windows计划任务时将无法获取它。
I want to schedule a Python program that reads the command line for
input. However, when adding an argument to the command line Python
will not pick it up when using Windows scheduled tasks.


如何让它工作?
How do I get it to work?



定义任务时是否编写命令行?使用双引号

围绕带空格的参数?

它适用于我。


-

Gabriel Genellina


Do you write the command line when defining the task? Using double quotes
around arguments with spaces?
It works fine for me.

--
Gabriel Genellina



我在预定任务上运行以下内容:

" J:\ Jim Crerar \ MyPython \ Zero_OE_Counter\Zero_OE_Counter.py n

" J:\ Jim Crerar \ MyPython \Zero_OE_Counter \ Zero_OE_Counter.py n"

" J:\ Jim Crerar \ MyPython \\ \\ _Zero_OE_Counter\Zero_OE_Counter.py n

他们都没有工作。

但是,从* .bat文件运行或直接从我的
快捷方式运行没问题桌面。

谢谢,

吉姆

I ran the following on the Scheduled Tasks:
"J:\Jim Crerar\MyPython\Zero_OE_Counter\Zero_OE_Counter.py " n
"J:\Jim Crerar\MyPython\Zero_OE_Counter\Zero_OE_Counter.py n"
"J:\Jim Crerar\MyPython\Zero_OE_Counter\Zero_OE_Counter.py " "n"
None of them work.
However, no problem with running from *.bat file or directly from
shortcut on my Desktop.
Thanks,
Jim


En Sat,2007年9月29日19:17: 49 -0300,Jim< js ****** @ compuserve.comescribi ???:
En Sat, 29 Sep 2007 19:17:49 -0300, Jim <js******@compuserve.comescribi???:

9月29日下午3:19,Gabriel Genellina" < gagsl -... @ yahoo.com.ar>

写道:
On Sep 29, 3:19 pm, "Gabriel Genellina" <gagsl-...@yahoo.com.ar>
wrote:

> En Sat,2007年9月29日17: 34:34 -0300,Jim< jscre ... @compuserve.com>
escribi?:
>En Sat, 29 Sep 2007 17:34:34 -0300, Jim <jscre...@compuserve.com>
escribi?:

我想安排一个读取的Python程序

输入的命令行。但是,当在命令行中添加参数时,Python

在使用Windows计划任务时将无法获取它。
I want to schedule a Python program that reads the command line for
input. However, when adding an argument to the command line Python
will not pick it up when using Windows scheduled tasks.


如何让它工作?
How do I get it to work?


定义任务时是否编写命令行?在空格的参数周围使用双引号?
它适用于我。


Do you write the command line when defining the task? Using double
quotes
around arguments with spaces?
It works fine for me.



我在计划任务上运行以下命令:

" J:\ Jim Crerar \ MyPython \Zero_OE_Counter \ Zero_OE_Counter.py" n

" J:\ Jim Crerar \ MyPython \Zero_OE_Counter \ Zero_OE_Counter.py n"

" J:\ Jim Crerar \ MyPython \\ \\ _Zero_OE_Counter\Zero_OE_Counter.py n

他们都没有工作。

但是,从* .bat文件运行或直接从我的
快捷方式运行没问题桌面。

I ran the following on the Scheduled Tasks:
"J:\Jim Crerar\MyPython\Zero_OE_Counter\Zero_OE_Counter.py " n
"J:\Jim Crerar\MyPython\Zero_OE_Counter\Zero_OE_Counter.py n"
"J:\Jim Crerar\MyPython\Zero_OE_Counter\Zero_OE_Counter.py " "n"
None of them work.
However, no problem with running from *.bat file or directly from
shortcut on my Desktop.



尝试预先添加Python可执行文件:


C:\Python25 \Python.exe" J:\ Jim

Crerar \ MyPython \Zero_OE_Counter \ Zero_OE_Counter.py" n


如果以这种方式工作,也许.py文件扩展名不正确

注册。


-

Gabriel Genellina

Try prepending the Python executable:

C:\Python25\Python.exe "J:\Jim
Crerar\MyPython\Zero_OE_Counter\Zero_OE_Counter.py " n

If it works this way, maybe the .py file extension is not correctly
registered.

--
Gabriel Genellina


这篇关于命令行在计划时确实有效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆