anchor.diff:  @ECHO OFF
   SET VBM="c:\program files\oracle\virtualbox\vboxmanage.exe"
   
  +rem Make sure we have the dd images (use AbittiUSB to download these)
  +IF NOT EXIST %LOCALAPPDATA%\YtlDigabi\koe.dd GOTO no_image_prof
  +IF NOT EXIST %LOCALAPPDATA%\YtlDigabi\ktp.dd GOTO no_image_prof
  +ECHO Images were found at %LOCALAPPDATA%\YtlDigabi\
  +SET KOE_PATH="%LOCALAPPDATA%\YtlDigabi\koe.dd"
  +SET KTP_PATH="%LOCALAPPDATA%\YtlDigabi\ktp.dd"
  +ECHO Using images from the profile:
  +ECHO KOE image path: %KOE_PATH%
  +ECHO KTP image path: %KTP_PATH%
  +GOTO create_vms
  +
  +:no_image_prof
  +ECHO Images missing (%LOCALAPPDATA%\YtlDigabi\*.dd)
  +IF NOT EXIST .\koe.dd GOTO no_image_here
  +IF NOT EXIST .\ktp.dd GOTO no_image_here
  +SET KOE_PATH=".\koe.dd"
  +SET KTP_PATH=".\ktp.dd"
  +ECHO Using images from the current directory:
  +ECHO KOE image path: %KOE_PATH%
  +ECHO KTP image path: %KTP_PATH%
  +GOTO create_vms
  +
  +:no_image_here
  +ECHO Images missing (.\*.dd)
  +ECHO Use either standard AbittiUSB or your browser to download the images.
  +GOTO end
  + 
  +:create_vms
   rem Shutdown existing VM:s
   %VBM% controlvm Abitti-KOE poweroff 
   %VBM% controlvm Abitti-KTP poweroff 
  
positive.code: %VBM% unregistervm Abitti-KOE --delete
  %VBM% unregistervm Abitti-KTP --delete
  
  rem Delete existing disk images
  IF NOT EXIST *.vdi GOTO Create_VMs
  
  SET /P ANSWER=VDI files exist. Delete vdi files? (Y/N)? 
  IF /i {%ANSWER%}=={y} (GOTO Remove_Disks)
  GOTO Create_VMs
  
  :Remove_Disks
  del *.vdi
  
  :Create_VMs
  rem Convert disk images
  %VBM% convertfromraw ktp.dd ktp.vdi --format vdi
  %VBM% convertfromraw koe.dd koe.vdi --format vdi
  
  rem Add more size to KTP/KOE image
  %VBM% modifyhd "%CD%\ktp.vdi" --resize 8192
  
negative.code: %VBM% storageattach Abitti-KOE --storagectl "SATA" --device 0 --port 0 --type hdd --medium "%CD%\koe.vdi"
  %VBM% storageattach Abitti-KTP --storagectl "SATA" --device 0 --port 0 --type hdd --medium "%CD%\ktp.vdi"
  
  REM If you have problems with audio try different audio controllers: "ac97", "hda", "sb16"
  %VBM% modifyvm Abitti-KOE --audiocontroller ac97
  
  rem Take initial snapshots
  %VBM% snapshot Abitti-KOE take "Before first boot"
  %VBM% snapshot Abitti-KTP take "Before first boot"
  
  echo All Done!
  :end
  pause