anchor.diff:  %VBM% unregistervm Abitti-KOE --delete
   %VBM% unregistervm Abitti-KTP --delete
   
  +rem Make sure there are no settings directory
  +IF NOT EXIST "%USERPROFILE%\VirtualBox VMs" GOTO vbox_directory_missing
  +IF EXIST "%USERPROFILE%\VirtualBox VMs\Abitti-KOE" GOTO vbox_vm_dir_exists
  +IF EXIST "%USERPROFILE%\VirtualBox VMs\Abitti-KTP" GOTO vbox_vm_dir_exists
  +GOTO check_vdifiles
  +
  +:vbox_vm_dir_exists
  +ECHO You have at least one of these two directories:
  +ECHO 1) %USERPROFILE%\VirtualBox VMs\Abitti-KOE
  +ECHO 2) %USERPROFILE%\VirtualBox VMs\Abitti-KTP
  +ECHO Please delete these directories and re-run this script.
  +GOTO end
  +
  +:vbox_directory_missing
  +ECHO Directory %USERPROFILE%\Virtualbox VMs is missing.
  +ECHO Execute VirtualBox at least once to create it.
  +GOTO end
  + 
  +:check_vdifiles
   rem Delete existing disk images
  -IF NOT EXIST *.vdi GOTO Create_VMs
  +IF NOT EXIST *.vdi GOTO convert_disks
   
   SET /P ANSWER=VDI files exist. Delete vdi files? (Y/N)? 
   IF /i {%ANSWER%}=={y} (GOTO Remove_Disks)
  -GOTO Create_VMs
  +GOTO convert_disks
   
   :Remove_Disks
   del *.vdi
   
  -:Create_VMs
  +:convert_disks
   rem Convert disk images
  -%VBM% convertfromraw ktp.dd ktp.vdi --format vdi
  -%VBM% convertfromraw koe.dd koe.vdi --format vdi
  +%VBM% convertfromraw %KTP_PATH% ktp.vdi --format vdi
  +%VBM% convertfromraw %KOE_PATH% koe.vdi --format vdi
  +rem %VBM% convertfromraw ktp_padded.dd ktp.vdi --format vdi
  +rem %VBM% convertfromraw koe_padded.dd koe.vdi --format vdi
   
   rem Add more size to KTP/KOE image
   %VBM% modifyhd "%CD%\ktp.vdi" --resize 8192
  
positive.code: @ECHO OFF
  SET VBM="c:\program files\oracle\virtualbox\vboxmanage.exe"
  
  rem Shutdown existing VM:s
  %VBM% controlvm Abitti-KOE poweroff 
  %VBM% controlvm Abitti-KTP poweroff 
  
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