[运行]中的Inno设置,空格和双引号 [英] Inno Setup, spaces and double quote in [Run]

查看:301
本文介绍了[运行]中的Inno设置,空格和双引号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Windows上安排任务,但是不幸的是,它无法正常工作! 任务已创建,但不正确.

I'm trying to schedule a task on Windows, and unfortunately, it doesn't work! The task is created but not correctly.

当我查看任务的参数时,它说:

When I look into task's parameters, it says:

PROGRAM: C:\Program
ARGUMENTS: Files(x86)\AppName\executable.exe

这是我的工作方式:

[Run]
Filename: "schtasks.exe"; Parameters: "/create /tn TaskName /sc MINUTE /mo 10 /tr ""{app}\{#MyAppExeName}""";

我不知道为什么它不起作用,双引号应该可以解决空格问题"

And I don't know why it doesn't work, doubles quotes should fix the "spaces problem"

有什么想法吗?

推荐答案

此问题是已知的,并在 this knowledge base article .您将需要在反斜杠和引号的组合之间包含文件名.那篇文章描述了:

This problem is known and is described in this knowledge base article. You will need to enclose the file name between combination of backslash and quotation marks. That article describes:

原因:

如果计划任务的路径包含一个 空间.例如对于如果您创建一个时间表,则会发生此问题 通过使用Schtasks.exe执行以下任务:

This problem occurs if the path of the scheduled task contains a space. For example, this problem occurs if you create a schedule for the following task by using Schtasks.exe:

 "c:\foldername containing spaces\task.bat"

解决方法:

要变通解决此问题,请封闭任务的路径部分(不要 反斜杠(\)和引号之间的参数(包括参数或开关) 标记()字符组合,例如\".附上完整的 引号之间的任务(包括参数或开关)的路径 创建包含空格的路径或命令时,照常标记.

To work around this problem, enclose the path portion of the task (not including arguments or switches) between backslash (\) and quotation marks (") character combinations, for example \". Enclose the complete path of the task (including arguments or switches) between quotation marks as usual when you create a path or command that contains spaces.

例如,当您计划以下示例任务时,该任务不会运行 它:

For example, the following example task does not run when you schedule it:

 schtasks /create /tn "my task" /tr "c:\foldername containing spaces\script.bat arguments" /sc once /sd 07/29/2003 /st 10:01

但是,当您在反斜杠之间包含任务的路径时 和引号字符组合,如下所示 例如,计划任务成功运行:

However, when you enclose the path of the task between the backslash and quotation marks character combinations as in the following example, the scheduled task runs successfully:

 schtasks /create /tn "my task" /tr "\"c:\foldername name containing spaces\script.bat\" arguments" /sc once /sd 07/29/2003 /st 10:01

因此,您的情况可能是:

So in your case it could be:

[Run]
Filename: "schtasks.exe"; Parameters: "/create /tn TaskName /sc MINUTE /mo 10 /tr ""\""{app}\{#MyAppExeName}\""";

这篇关于[运行]中的Inno设置,空格和双引号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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