views:

1071

answers:

5

I am trying to use an autorun.inf to run my executable file under a sub-folder with space in their 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
+2  A: 

My uninformed guess: use quotes.

[autorun]
open="FOLDER NAME 1\Setup.exe"
icon="FOLDER NAME 1\Setup.exe"
Thomas
With so many votes, but it still not works for me..
redjackwong
A: 

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
+5  A: 

With some trials I have found pair of double quotes are needed. Sounds starnge though.

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

This worked for me. The first suggestion didn't.
JoelHess
+2  A: 

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
A: 

This also works:

open=.\FOLDER NAME 1\Setup.exe

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

Gremo