7

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:

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]
open=FOLDER NAME 1\Setup.exe
icon=FOLDER NAME 1\Setup.exe
PythoNic
  • 303
  • 5
  • 13
redjackwong
  • 1,568
  • 2
  • 12
  • 14

5 Answers5

17

With some trials I have found that pairs of double quotes are needed. Sounds strange though.

open=""FOLDER NAME 1\Setup.exe""

Josh Kelley
  • 56,064
  • 19
  • 146
  • 246
6

Expanding on from Sanjay's answer of using two sets of quotes, like

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"
Wilka
  • 28,701
  • 14
  • 75
  • 97
2

My uninformed guess: use quotes.

[autorun]
open="FOLDER NAME 1\Setup.exe"
icon="FOLDER NAME 1\Setup.exe"
Thomas
  • 174,939
  • 50
  • 355
  • 478
1

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

SoapBox
  • 20,457
  • 3
  • 51
  • 87
0

This also works:

open=.\FOLDER NAME 1\Setup.exe

edit: works for icon, NOT for open command...a bit strange!

gremo
  • 47,186
  • 75
  • 257
  • 421