windows Autorun.inf 打开一个创建目录的批处理文件不起作用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23384608/
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 opens a batch file which creates a directory doesn't work
提问by Martin Rezyne
I'm trying to make a autorun.inf file which would open a .bat file from a flash drive.
我正在尝试制作一个 autorun.inf 文件,该文件将从闪存驱动器中打开一个 .bat 文件。
What I have in the autorun.inf file:
我在 autorun.inf 文件中有什么:
[autorun]
open=launch.bat
icon=icon.ico
What I have in the launch.bat file:
我在launch.bat文件中有什么:
@echo off
::start
mkdir "C:\ThisIsATest"
exit
When I have inserted the flash drive to my personal computer, I have noticed that the icon of the drive has changed, but I can't see the effect of the launch.bat file. I have tried the batch file to see if it works and it works. Thus, I believe that the autorun.inf file doesn't work.
当我把U盘插入我的个人电脑时,我注意到U盘的图标发生了变化,但是我看不到launch.bat文件的效果。我已经尝试过批处理文件,看看它是否有效并且有效。因此,我相信 autorun.inf 文件不起作用。
As I have read from the Internet, it matters that I have Windows 8 and Windows 7.
正如我从 Internet 上看到的那样,我拥有 Windows 8 和 Windows 7 很重要。
What can I do to solve this problem?
我能做些什么来解决这个问题?
回答by ZippyV
autorun.inf
is not executed anymore on flash drives. These days it only works for CD's or DVD's, but the user still needs to allow it first.
autorun.inf
不再在闪存驱动器上执行。现在它只适用于 CD 或 DVD,但用户仍然需要先允许它。
回答by Mr.Helper
Can it be that making the folder in C: needs Admin rights? Try creating the folder on the desktop.
是否可以在 C: 中创建文件夹需要管理员权限?尝试在桌面上创建文件夹。
回答by 09stephenb
Try using this instead:
尝试改用这个:
[autorun]
icon=icon.ico
open=launch.bat
action=Click to run.
shell\open\command=launch.bat
Hope it helps.
希望能帮助到你。
Edit:You could also try compiling your batch file into a exe using this: http://www.battoexeconverter.com/
编辑:您也可以尝试使用以下方法将批处理文件编译为 exe:http: //www.battoexeconverter.com/
Try having a look here: http://www.sevenforums.com/tutorials/216706-autoplay-enable-disable.html
试试看这里:http: //www.sevenforums.com/tutorials/216706-autoplay-enable-disable.html