windows Autorun.inf 无法处理文件夹名称中有空格的子文件夹?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/593311/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Autorun.inf cannot deal with the sub-folders with space in their folder name?
提问by redHymanwong
I am trying to use an autorun.inf to run my executable file under a sub-folder with space in its folder name. Like this:
我正在尝试使用 autorun.inf 在文件夹名称中有空格的子文件夹下运行我的可执行文件。像这样:
H:\
autorun.inf
FOLDER NAME 1
file.exe
FOLDER NAME 2
some other stuffs
If there's no space in the folder name, it works well. But if there are some, it's not work for me.
如果文件夹名称中没有空格,则效果很好。但如果有一些,它对我不起作用。
Is this a restrict? or I am doing something wrong?
这是限制吗?或者我做错了什么?
My autorun.inf:
我的 autorun.inf:
[autorun]
open=FOLDER NAME 1\Setup.exe
icon=FOLDER NAME 1\Setup.exe
回答by
With some trials I have found that pairs of double quotes are needed. Sounds strange though.
通过一些试验,我发现需要成对的双引号。虽然听起来很奇怪。
open=""FOLDER NAME 1\Setup.exe""
open=""文件夹名称 1\Setup.exe""
回答by Wilka
Expanding on from Sanjay's answer of using two sets of quotes, like
从 Sanjay 使用两组引号的答案进行扩展,例如
open=""FOLDER NAME 1\Setup.exe""
If you want your icon from the folder, you need to put a single set of quotes around the whole line. E.g.
如果您想要文件夹中的图标,则需要在整行周围加上一组引号。例如
icon="FOLDER NAME 1\Setup.exe,0"
回答by Thomas
My uninformed guess: use quotes.
我不知情的猜测:使用引号。
[autorun]
open="FOLDER NAME 1\Setup.exe"
icon="FOLDER NAME 1\Setup.exe"
回答by SoapBox
In addition to doing as Thomas suggests and using quotes, you can also use the short/"DOS" style names. Which are the first 6 letters of the name followed by a tilde (~) and then a number. So "FOLDER NAME 1" would usually become "FOLDER~1".
除了按照 Thomas 的建议使用引号之外,您还可以使用短/“DOS”样式名称。这是名称的前 6 个字母,后跟波浪号 (~),然后是数字。所以“FOLDER NAME 1”通常会变成“FOLDER~1”。
回答by gremo
This also works:
这也有效:
open=.\FOLDER NAME 1\Setup.exe
edit: works for icon, NOT for open command...a bit strange!
编辑:适用于图标,不适用于打开命令......有点奇怪!