This is how it's done under Windows XP:
- Open Windows Explorer (by pressing the Windows + "e" key).
- Right-click the desired CD-ROM and select Properties from the menu.
- Select the AutoPlay tab.
- Select each item from the pulldown list and for the Action to perform, select "Take no action" to disable autorun, or pick the apporpriate action to take if enabling autorun.
- Select OK.
And for Windows 7 see
AutoPlay - Enable or Disable AutoRun - Windows 7 Forums