# Creating an autorun CD on Vista



## daraclare (Jun 19, 2009)

Hi folks, 

I've designed a web site and need to burn it to a CD so my friend can take it around with him. I use a mac and he uses a Windows Vista machine. I have tried making a autorun.inf document in TextEdit (same as NotePad) but it didn't work. It only contained the text:

"[autorun]

shellexecute=index.html"

I also want it to open in full screen if possible. 

Can anyone help? I have a lend of a friends vista computer for the next day or so so at least I can test this out.

I'm a designer and usually work for print so very unsure of this area, (as you might have guessed) and any help would be much appreciated. Do I need to create an .exe doc and if so how? 

Thanks in advance folks.

DC


----------



## N Raj (Apr 14, 2009)

Ok.. done some thinking (programming isnt my main forte but I still think I know my way around lol)

This should now work, save it as "Autorun.inf"


```
[autorun]
open=command /c start /max index.htm

icon=icon.jpg
label=Name you Icon
```
It will run full screen but restricts the cd to auto running on windows machines only due to the "command" and "start" functions. If you would like an icon aswell, then place the picture in the root directory of the cd.

You could, however, also use a plain and simple, save it as "Autorun.inf"


```
[autorun]
ShellExecute=index.htm

icon=myicon.jpg
label=Name you Icon
```
and place this javascript inside the body tag


```
<script type="text/javascript">
    <!--
    if (document.all || document.layers)
    **
      window.moveTo(0,0);
      window.resizeTo(screen.availWidth,screen.availHeight)
    } else if (window.screen) **
      window.moveTo(0,0);
      window.outerHeight = screen.availHeight;
      window.outerWidth = screen.availWidth;
    }
    //-->
    </script>
```
Strictly speaking it doesn't "maximise" the window, it just stretches to fit the screen, you can probably see that anyway. This would allow the cd to run on both windows and non-windows platforms.

I think the reason why your autorun didn't work is because (had a similar problem on my first time) is that capitals do play an important roll. The 'S' and 'E' ought to be capitals


----------



## daraclare (Jun 19, 2009)

_"It will run full screen but restricts the cd to auto running on windows machines only due to the "command" and "start" functions."_

This is fine but I tried the simple inf containing the text:

[autorun]
open=command /c start /max index.html

icon=icon.jpg
label=Crystal Conservatories

Have I done something wrong? Thanks for the help by the way.

Cheers,

DC


----------



## N Raj (Apr 14, 2009)

hmmm I am not sure what the icon should look like on a mac, but is this what you have?


----------



## daraclare (Jun 19, 2009)

Yes, exactly.


----------



## N Raj (Apr 14, 2009)

Apologies for not replying promptly, cricket it on 

And this is placed in the root directory of the cd with "index.html" also in the root directory.

If this is is the case, then next thing to deduce is you are trying this on a windows pc and that pc has autoplay enabled.


----------



## daraclare (Jun 19, 2009)

I'm on a Vista laptop and I have enabled autoplay as far as I can see.

Thanks for the help.

DC


----------



## N Raj (Apr 14, 2009)

ok... I might be becoming redundant soon lol, vista and programming is my main forte as I mentioned above but lets see what we can do while I am still here 

Lets start by double checking you are running as administrator and that auto play is running, vista can be a real pain!!
============================================

Ensure that Shell Hardware Detection service is running

Type “service.msc” in Start Search to run Services console. Locate Shell Hardware Detection, and ensure that the “Service Status” is Running, and “Startup Type” is Automatic. If not, start the service and change the Startup Type setting accordingly.
============================================

Ensure that CD-ROM AutoRun is not disabled in registry

For users facing AutoRun/AutoPlay doesn’t work when insert a disc into optical drive, run Registry Editor (regedit), and navigate to the following registry subkey:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\CDRom

Locate the AutoRun registry value in the right pane, and check that the value data for AutoRun is set as 1 (one), which is enabled. If it is 0 (zero), which mean disabled CD-ROM or DVD-ROM drive AutoRun process, re-enable the AutoRun by changing the value to 1.
============================================

Ensure that correct NoDriveTypeAutoRun and/or NoDriveAutoRun policy value is set

NoDriveTypeAutoRun registry key is used by Group Policy to configure whether to disable the Autoplay feature on all drives of the type specified. To check this setting, run Registry Editor (regedit), and navigate to the following registry key:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

or (note that above registry value, if exists, will always supersede the below user-specific key),

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer


----------



## N Raj (Apr 14, 2009)

This is on the microsoft website, I am trying to find that "autofix" they released some time ago. Would rather not trust downloading it from other sources 

Anyway, in the mean time, I still feel it might be an autoplay issue or the disc isnt being burnt properly. What sort of disc are you using, if it is a RW then slow down the burn speed. The slower the burn the better the quality.

There are several reasons for this problem. AutoPlay might be restricted by Group Policy, it could be canceled by a program that is running, or the service that AutoPlay needs to start might not be running.

Here are some things to try:
•	

Ask your network administrator if AutoPlay is restricted by Group Policy, and if so, what to do instead.
•	

Close other programs that might be interfering.
•	

Follow these steps:


1. 

Click the Start button Picture of the Start button, click All Programs, click Accessories, and then right-click Command Prompt.
2. 

Click Run as administrator.
3. 

At the command prompt, type net start shellhwdetection, and then press ENTER.
4. 

Restart your computer.


----------



## N Raj (Apr 14, 2009)

I have also sent you a pm as to ignore my previous two posts, I will keep them here just incase we need need them 

I have been thinking it might be the coding, and we are doing a painfully long process elimination that may not be required.

Check here http://www.duckware.com/winopen/index.html



> HTML: To create a CD where your index.html HTML file automatically appears in the default web browser when your CD is inserted into a customer's computer, create/burn a CD with the following files in the root of the CD:
> 
> autorun.inf
> winopen.exe
> ...




```
[autorun]
    open=winopen \index.html
    label=Acme Product Manual
    action=View Acme Product Manual
    icon=acme.ico
```
That is all you need!

*For your benefit I scanned the file with virustotal*

https://www.virustotal.com/analisis...d2a92a3af166284b831d586599a2bf6499-1245439070



> Antivirus Version Last Update Result
> a-squared	4.5.0.18	2009.06.19	-
> AhnLab-V3	5.0.0.2	2009.06.19	-
> AntiVir	7.9.0.193	2009.06.19	-
> ...


----------



## daraclare (Jun 19, 2009)

Okay, I'm just getting confused here, sorry. Are there any programmers on this site/forum that you may know of that may know where I'm going wrong? Apologies, no offence meant.

DC


----------



## N Raj (Apr 14, 2009)

my Apologies, its very simple, it is my babbling which is causing the great confusion.

In the root directory of your CD place your


autorun.inf
winopen.exe
index.html

you can get winopen from here http://www.duckware.com/winopen/index.html

and now the cd should autorun on vista. 

The autorun.inf ought to read


```
[autorun]
    open=winopen \index.html
    label=[I]Name for your icon[/I]
    icon=[i]image.ico[/i]
```
If this now does not work, then it is beyond me what is happening!!


----------



## daraclare (Jun 19, 2009)

Great Thanks I will try that again when I can borrow another computer Cheers for all the help!


----------



## daraclare (Jun 19, 2009)

Fantastic! That worked perfectly. Was starting to pull my hair out a little. Can I also ask how to make the HTML full screen without the internet browser tools etc appearing? is that possible? I really appreciate your help on this.

DC


----------



## N Raj (Apr 14, 2009)

Yer I am a 'G' (the kids are all saying it :smile. I am so glad that it worked for you. With regards to the browsers tools try..

```
<script type='text/javascript'>

var height = 400                      //Set height
var width = 400                        //Set width
var name = "winname"             //Set window name
var top = 20                             //Set distance from top
var left = 20                             //Set distance from bottom

if(document.location.search=='')  **
 newwin=window.open(document.location + "?newwin=true", name, "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,width=" + width + ",height=" + height + ",left=" + left + ",top=" + top);
 self.close()
}

</script>
```
If that doesnt work, then there is more than one way to skin the cat lol


----------



## N Raj (Apr 14, 2009)

Actually try this one, a bit simpler javascripting

TWO STEPS TO INSTALL FULL SCREEN WINDOW:

1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document

STEP ONE: Paste this code into the HEAD of your HTML document



```
<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
function fullScreen(theURL) **
window.open(theURL, '', 'fullscreen=yes, scrollbars=auto');
}
//  End -->
</script>
```
STEP TWO: Copy this code into the BODY of your HTML document

```
<BODY>

<a href="javascript:void(0);" onClick="fullScreen('full-screen.html');">Open Full Screen Window</a>
```


----------



## daraclare (Jun 19, 2009)

No joy with that. Thanks anyway.


----------



## N Raj (Apr 14, 2009)

If you read this before the edit scratch it!

PLace this in your head tag


```
<script>
<!--
window.open("bigpage.html","fs","fullscreen,scrollbars")
//-->
</script>
```
Where it says "bigpage.html" change it to the page you want well.. big

Now add a button to close it (or make them press alt-f4 your choice lol)


```
<FORM>
<INPUT TYPE="button" VALUE="Close the Window" onClick="window.close('fs')">
</FORM>
```
This really ought to work"


----------



## daraclare (Jun 19, 2009)

Thanks I think that worked perfectly. Will have to check it when I borrow a windows machine but works on the mac so happy days! Thanks again!


----------



## N Raj (Apr 14, 2009)

I am a genius! lol, More than happy to help you, sorry for my slight confusion earlier I was mass posting as soon as something came to me


----------

