Synyax Help for createfile [Resolved]

(imported topic written by murtasma91)

I am trying to create a custom copy of the Java Fixlet provided by BigFix. I want to remove the Java\jre6 folder before attempting to run the installer. This is a fix for several workstations here that have corrupted Java installs. I have tested the section following section of code sucessfully in a custom action script and it works as expected

createfile until ENDOFFILEMARKER rmdir /S /Q 
"%ProgramFiles(x86)%\Java\jre6" ENDOFFILEMARKER

I then tried to create some logic to determine which Program Files path to use based on if the OS is 32 or 64 bit. Here is the complete code for the java package,

download http:
//www.sun.com/MANUAL_BES_CACHING_REQUIRED/jre-6u21-windows-i586.exe   

continue 

if 
{(size of it = 16062240 AND sha1 of it = 
"3a651bebdce5f3c787fb50735032dee0ef2a1dbe") of file 
"jre-6u21-windows-i586.exe" of folder 
"__Download"
}   
// Note: update .exe will restart service automatically 

if
{exists running service 
"JavaQuickStarterService"
} delete __appendfile delete stop_javaquickstarter.bat appendfile net stop JavaQuickStarterService move __appendfile stop_javaquickstarter.bat waithidden stop_javaquickstarter.bat endif     

if 
{x64 of operating system
}   createfile until ENDOFFILEMARKER rmdir /S /Q 
"%ProgramFiles(x86)%\Java\jre6" ENDOFFILEMARKER   copy __createfile removejava.bat dos removejava.bat delete removejava.bat   endif   

if 
{not x64 of operating system
}   createfile until ENDOFFILEMARKER rmdir /S /Q 
"%ProgramFiles%\Java\jre6" ENDOFFILEMARKER   copy __createfile removejava.bat dos removejava.bat delete removejava.bat   end 

if       wait __Download/jre-6u21-windows-i586.exe /quiet /norestart /log c:\temp\java.log   action may require restart 
"3a651bebdce5f3c787fb50735032dee0ef2a1dbe"

The console reports "Unable to prase action script for Action 1 line 26

which is this line

rmdir /S /Q 
"%ProgramFiles%\Java\jre6"

How can I get this logic to work properly with the createfile function? I found on the forum there is a Folder Delete command but I was unable to get this command to work sucessfully on my workstation. I was also unable to locate any actual documentation on this command besides the one forum post here that mentions it.

EDIT: Looks like the problem was the space between end if should have been endif