Martin Rezyne
Martin Rezyne

Reputation: 445

Autorun.inf opens a batch file which creates a directory doesn't work

I'm trying to make a autorun.inf file which would open a .bat file from a flash drive.

What I have in the autorun.inf file:

[autorun]
open=launch.bat
icon=icon.ico

What I have in the launch.bat file:

@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.

As I have read from the Internet, it matters that I have Windows 8 and Windows 7.

What can I do to solve this problem?

Upvotes: 1

Views: 38606

Answers (3)

Mr.Helper
Mr.Helper

Reputation: 1

Can it be that making the folder in C: needs Admin rights? Try creating the folder on the desktop.

Upvotes: 0

09stephenb
09stephenb

Reputation: 9816

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/

Try having a look here: http://www.sevenforums.com/tutorials/216706-autoplay-enable-disable.html

Upvotes: -1

ZippyV
ZippyV

Reputation: 13058

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.

Upvotes: 2

Related Questions