directory change,@path(%0) 
  external vdsbin.dll 
  external @path(%0)mt.dll 
  %%job = CleanUpAgent.job 
  gosub ADD_TO_TASK_SCHEDULER 
  if @not(@equal(%%JOB_ERROR,1)) 
    info Added Task Successfully ! 
  else 
    warn Could Not Create Job for Scheduling Agent ! 
  end 
  stop 

  rem *** SUB ROUTINES 
:ADD_TO_TASK_SCHEDULER 
  %%tasks_dir = @regread(LOCAL,Software\Microsoft\SchedulingAgent,TasksFolder,0) 
  rem %%TASKS_DIR = c:\windows\skrivebord 
  if @zero(%%TASKS_DIR) 
    warn The Microsoft Scheduling Agent is not installed.@cr()@cr()It is required for adding the CleanUp Agent to the Schedule 
    %%job_error = 1 
    exit 
  end 

  %%job = %%TASKS_DIR\%%JOB 
  file delete,%%JOB 

  fileio open,%%JOB,,EXCLUSIVE 
  fileio seek,0,start 
  fileio write,47040100DFC60D003E031C00A8F06104000000004600F000000000003C000A00200000000014730F0000000003130400C000800100000000000000000000000000000000000021 
  rem *** WRITE EXE 
  %%task_exe = @path(%0)@name(%0).@ext(%0) 
  %%string = %%TASK_EXE 
  gosub GET_ASCII_TO_HEX 
  fileio write,%%STRING 
  fileio write,00000006 

  rem *** WRITE COMMAND LINE PARAMETERS 
  %%commandline = /AUTO 
  %%string = %%COMMANDLINE 
  gosub GET_ASCII_TO_HEX 
  fileio write,%%STRING 
  fileio write,00000017 

  rem *** WRITE PATH 
  %%task_exe_path = @path(%0) 
  %%string = %%TASK_EXE_PATH 
  gosub GET_ASCII_TO_HEX 
  fileio write,%%STRING 
  fileio write,0000000C 

  rem *** WRITE USER 
  %%task_user = @mt(sysinfo,UserName) 
  %%string = %%TASK_USER 
  gosub GET_ASCII_TO_HEX 
  fileio write,%%STRING 

  rem *** WRITE END & CLOSE 
  fileio write,0000000000000008000313040000000000010030000000D10705001A000000000000000000000000000000000000000000000007000000010000000000000000000000 
  fileio close 
  %%job_error = 0 
  exit 

:GET_ASCII_TO_HEX 
  if @null(%%STRING) 
    exit 
  end 

  %c = 1 
  repeat 
    %%char = @substr(%%STRING,%C,%C) 
    %a = @asc(%%CHAR) 
    %a = @hex(%A) 
    %%hex = %%HEX%A 
    %c = @succ(%C) 
  until @greater(%C,@len(%%STRING)) 
  %%string = %%HEX 
  %a = 
  %%hex = 
  %%char = 
  exit