Question

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
Was it helpful?

Solution

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

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

OTHER TIPS

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"

My uninformed guess: use quotes.

[autorun]
open="FOLDER NAME 1\Setup.exe"
icon="FOLDER NAME 1\Setup.exe"

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

This also works:

open=.\FOLDER NAME 1\Setup.exe

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top