This section contains tools to prepare your card for use with the canon script system.


Backup the Data on your SD-Card before you continue.


Avoid executing Canon Basic scripts when CHDK is loaded, unless you know what you are doing. Explained [here].


The following are required to run a canon script. The tools below can be used to set this up

  • The SD card may be in FAT16 or FAT32 format.
  • The SD card may need to be low-level formatted in the camera first.
  • The SD card must contain the following items:
  1. The string "SCRIPT" must be at offset 0x1F0 of the first sector (Boot sector of the partition).
  2. The file "script.req" must exist on the card's root directory, and must only contain the string "for DC_scriptdisk" (works without any trailing newline character)
  3. The file "extend.m" must exist on the root directory. This file must contain the Canon BASIC script to execute.
  4. Start the camera in Play Mode then click the FUNC./SET button to run the script. Some touchscreen cameras run the script when the focus lever is turned to the left.


The following lua script prepares a script disk on camera. You must have Native function call support enabled in the CHDK miscellaneous menu.

@title prepare script disk
if not f then
	error("file open failed")
f:write("for DC_scriptdisk")

if call_event_proc("SystemEventInit") == -1 then



The following shell script is adapted from Alfredo and Orens original documentation. This should be applicable to most unixish systems, but may need some adjustment for your specific system.

Note: Mac OSX users can prepare cards using my MacBoot app (which does pretty much what the unix script does but somewhat more safely). Download from


This script could damage your system if you tell it to use the wrong device. Make sure you know which device is your SD card, and that the usage of /mnt is compatible with your system.

#Enable powershot basic scripting on a memory card
if [ $# -ne 1 ] ; then
  echo "Usage : ./ [ device ]"
  echo " [ device ] is a fat32 / fat16 partition on the memory card"
  echo " example : ./ /dev/sdb1"
  echo "NOTE: please run as root"
  exit 112
echo Boot sector of $1 will be modified. If you are not sure this is what you want then cancel with Ctrl-C
sleep 8
#TAG on boot sector
if ! echo -n SCRIPT | dd bs=1 count=6 seek=496 of=$1 ; then {
   echo failed writing to boot sector
   exit 113
} fi
if mount | grep /mnt ; then {
    umount /mnt
} fi
if ! mount $1 /mnt ; then {
    echo failed to mount
    exit 114
} fi
#create script request file
echo -n "for DC_scriptdisk" > /mnt/script.req
#Example script
echo 'private sub sayHello()
  LCDMsg_SetStr(a,"Hello World!")
end sub
private sub Initialize()
end sub
#Done !
echo "Please check /mnt for files extend.m and script.req"



The EOScard utility can be used to prepare the cards boot sector with the "SCRIPT" string.

  • Start EOSCard, select your SD card drive
  • Check [x] SCRIPT in the Strings section, uncheck all other options there
  • Press "Save" to write the boot sector
  • You'll get a feedback information in the status bar
  • Close EOSCard
  • Create the "script.req" file and save your script like described in Canon_Basic/Card_Setup#Overview
  • Remove the SD card using the "safely remove hardware" icon from the taskbar

Disk editor[]

On Windows a Disk Editor can be used to write the string "SCRIPT" onto the SD-Card.

Double check the drive / drive letter to avoid killing your hard disk drive(s) !


Canon scriptdisk hxd

HxD - Canon Script Disk