Strange "Unknown Action Command" error while coding Quicktime action

(imported topic written by scott.craddolph91)

I’m working on code to uninstall quicktime on my network - I coded the following but for some reason I get a syntax error “unknown action command” on line 51 which is a comment:

//uninstall quicktime 7.4.5.67

if exists keys whose (value “DisplayVersion” of it = “7.4.5.67”) of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry then

wait C:\WINDOWS\system32\msiexec.exe /uninstall {{1838C5A2-AB32-4145-85C1-BB9B8DFA24CD} /passive

else

//uninstall quicktime 7.4.1.14

if exists keys whose (value “DisplayVersion” of it = “7.4.1.14”) of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry then

wait C:\WINDOWS\system32\msiexec.exe /uninstall {{BFD96B89-B769-4CD6-B11E-E79FFD46F067} /passive

else

//uninstall quicktime 7.4.0.91

if exists keys whose (value “DisplayVersion” of it = “7.4.0.91”) of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry then

wait C:\WINDOWS\system32\msiexec.exe /uninstall {{6EC874C2-F950-4B7E-A5B7-B1066D6B74AA} /passive

else

//uninstall quicktime 7.0.3

if exists keys whose (value “DisplayVersion” of it = “7.0.3”) of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry then

wait C:\PROGRA~1\COMMON~1\INSTAL~1\Driver\11\INTEL3~1\IDriver.exe /M {{3868A8EE-5051-4DB0-8DF6-4F4B8A98D083} /uninst /s

else

//uninstall quicktime 7.3.1.70

if exists keys whose (value “DisplayVersion” of it = “7.3.1.70”) of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry then

wait C:\WINDOWS\system32\msiexec.exe /uninstall {{E0D51394-1D45-460A-B62D-383BC4F8B335} /passive

else

//uninstall quicktime 7.3.0.70

if exists keys whose (value “DisplayVersion” of it = “7.3.0.70”) of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry then

wait C:\WINDOWS\system32\msiexec.exe /uninstall {{9763E36A-08E9-4228-BBCE-12989A4EB1A8} /passive

else

//uninstall quicktime 7.2.0.240

if exists keys whose (value “DisplayVersion” of it = “7.2.0.240”) of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry then

wait C:\WINDOWS\system32\msiexec.exe /uninstall {{95A890AA-B3B1-44B6-9C18-A8F7AB3EE7FC} /passive

else

//uninstall quicktime 7.1.6.200

if exists keys whose (value “DisplayVersion” of it = “7.1.6.200”) of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry then

wait C:\WINDOWS\system32\msiexec.exe /uninstall {{08094E03-AFE4-4853-9D31-6D0743DF5328} /passive

else

//uninstall quicktime 7.1.5.120

if exists keys whose (value “DisplayVersion” of it = “7.1.5.120”) of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry then

wait C:\WINDOWS\system32\msiexec.exe /uninstall {{5E863175-E85D-44A6-8968-82507D34AE7F} /passive

else

//uninstall quicktime 7.1.3.100

if exists keys whose (value “DisplayVersion” of it = “7.1.3.100”) of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry then

wait C:\WINDOWS\system32\msiexec.exe /uninstall {{F07B861C-72B9-40A4-8B1A-AAED4C06A7E8} /passive

else

//uninstall quicktime 7.1

if exists keys whose (value “DisplayVersion” of it = “7.1”) of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry then

wait C:\PROGRA~1\COMMON~1\INSTAL~1\Driver\11\INTEL3~1\IDriver.exe /M {{C21D5524-A970-42FA-AC8A-59B8C7CDCA31} /uninst /s

else

//uninstall quicktime 7.0.4

if exists keys whose (value “DisplayVersion” of it = “7.0.4”) of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry then

wait C:\PROGRA~1\COMMON~1\INSTAL~1\Driver\11\INTEL3~1\IDriver.exe /M {{929408E6-D265-4174-805F-81D1D914E2A4} /uninst /s

else

//uninstall quicktime 7.0.3

if exists keys whose (value “DisplayVersion” of it = “7.0.3”) of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry

then

wait C:\PROGRA~1\COMMON~1\INSTAL~1\Driver\11\INTEL3~1\IDriver.exe /M {{0B69DA57-BC7D-461D-B7D6-2AA9F08869CD} /uninst /s

else

//uninstall quicktime 7.0.2

if exists keys whose (value “DisplayVersion” of it = “7.0.2”) of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry then

wait C:\PROGRA~1\COMMON~1\INSTAL~1\Driver\11\INTEL3~1\IDriver.exe /M {{7A8658B8-174E-498E-86CF-F2A40B21F579} /uninst /s

endif

I would appreciate if someone can take a look at the code.

Thanks,

Scott Craddolph

(imported comment written by jessewk)

You have 2 syntax errors… First, anything that you want evaluated as relevance needs to be in curly braces {}

Second, You need a corresponding endif for each if statement.

Also, to make this work on all OSes, instead of hard coding the path to the system folder, you should use relevance substitution.

Try it something like this:

//uninstall quicktime 7.4.5.67
if {exists keys whose (value “DisplayVersion” of it = “7.4.5.67”) of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry}
wait {pathname of system folder}\msiexec.exe /uninstall {{1838C5A2-AB32-4145-85C1-BB9B8DFA24CD} /passive
endif
//uninstall quicktime 7.4.1.14
if {exists keys whose (value “DisplayVersion” of it = “7.4.1.14”) of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry}
wait {pathname of system folder}\msiexec.exe /uninstall {{BFD96B89-B769-4CD6-B11E-E79FFD46F067} /passive
endif

Jesse

(imported comment written by pmullins91)

Double check this to make sure it still does what you want it to. :wink:

Not sure exactly what was hosing it up but these seem to run through OK in the fixlet debugger.

Check for all versions:

//uninstall quicktime 7.4.5.67 

if (exists keys whose (value 
"DisplayVersion" of it = 
"7.4.5.67") of key 
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) then wait C:\WINDOWS\system32\msiexec.exe /uninstall  
{
{1838C5A2-AB32-4145-85C1-BB9B8DFA24CD
} /passive endif   
//uninstall quicktime 7.4.1.14 

if (exists keys whose (value 
"DisplayVersion" of it = 
"7.4.1.14") of key 
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) then wait C:\WINDOWS\system32\msiexec.exe /uninstall  
{
{BFD96B89-B769-4CD6-B11E-E79FFD46F067
} /passive endif   
//uninstall quicktime 7.4.0.91 

if (exists keys whose (value 
"DisplayVersion" of it = 
"7.4.0.91") of key 
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) then wait C:\WINDOWS\system32\msiexec.exe /uninstall  
{
{6EC874C2-F950-4B7E-A5B7-B1066D6B74AA
} /passive endif   
//uninstall quicktime 7.0.3 

if (exists keys whose (value 
"DisplayVersion" of it = 
"7.0.3") of key 
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) then wait C:\PROGRA~1\COMMON~1\INSTAL~1\Driver\11\INTEL3~1\IDriver.exe /M 
{
{3868A8EE-5051-4DB0-8DF6-4F4B8A98D083
} /uninst /s endif   
//uninstall quicktime 7.3.1.70 

if (exists keys whose (value 
"DisplayVersion" of it = 
"7.3.1.70") of key 
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) then wait C:\WINDOWS\system32\msiexec.exe /uninstall  
{
{E0D51394-1D45-460A-B62D-383BC4F8B335
} /passive endif   
//uninstall quicktime 7.3.0.70 

if (exists keys whose (value 
"DisplayVersion" of it = 
"7.3.0.70") of key 
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) then wait C:\WINDOWS\system32\msiexec.exe /uninstall  
{
{9763E36A-08E9-4228-BBCE-12989A4EB1A8
} /passive endif   
//uninstall quicktime 7.2.0.240 

if (exists keys whose (value 
"DisplayVersion" of it = 
"7.2.0.240") of key 
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) then wait C:\WINDOWS\system32\msiexec.exe /uninstall  
{
{95A890AA-B3B1-44B6-9C18-A8F7AB3EE7FC
} /passive endif   
//uninstall quicktime 7.1.6.200 

if (exists keys whose (value 
"DisplayVersion" of it = 
"7.1.6.200") of key 
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) then wait C:\WINDOWS\system32\msiexec.exe /uninstall  
{
{08094E03-AFE4-4853-9D31-6D0743DF5328
} /passive endif   
//uninstall quicktime 7.1.5.120 

if (exists keys whose (value 
"DisplayVersion" of it = 
"7.1.5.120") of key 
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) then wait C:\WINDOWS\system32\msiexec.exe /uninstall  
{
{5E863175-E85D-44A6-8968-82507D34AE7F
} /passive endif   
//uninstall quicktime 7.1.3.100 

if (exists keys whose (value 
"DisplayVersion" of it = 
"7.1.3.100") of key 
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) then wait C:\WINDOWS\system32\msiexec.exe /uninstall  
{
{F07B861C-72B9-40A4-8B1A-AAED4C06A7E8
} /passive endif   
//uninstall quicktime 7.1 

if (exists keys whose (value 
"DisplayVersion" of it = 
"7.1") of key 
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) then wait C:\PROGRA~1\COMMON~1\INSTAL~1\Driver\11\INTEL3~1\IDriver.exe /M 
{
{C21D5524-A970-42FA-AC8A-59B8C7CDCA31
} /uninst /s endif   
//uninstall quicktime 7.0.4 

if (exists keys whose (value 
"DisplayVersion" of it = 
"7.0.4") of key 
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) then wait C:\PROGRA~1\COMMON~1\INSTAL~1\Driver\11\INTEL3~1\IDriver.exe /M 
{
{929408E6-D265-4174-805F-81D1D914E2A4
} /uninst /s endif   
//uninstall quicktime 7.0.3 

if (exists keys whose (value 
"DisplayVersion" of it = 
"7.0.3") of key 
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) then wait C:\PROGRA~1\COMMON~1\INSTAL~1\Driver\11\INTEL3~1\IDriver.exe /M 
{
{0B69DA57-BC7D-461D-B7D6-2AA9F08869CD
} /uninst /s endif   
//uninstall quicktime 7.0.2 

if (exists keys whose (value 
"DisplayVersion" of it = 
"7.0.2") of key 
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) then wait C:\PROGRA~1\COMMON~1\INSTAL~1\Driver\11\INTEL3~1\IDriver.exe /M 
{
{7A8658B8-174E-498E-86CF-F2A40B21F579
} /uninst /s endif

-or-

Remove and stop at first version found:

if (exists keys whose (value 
"DisplayVersion" of it = 
"7.4.5.67") of key 
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) then 
//uninstall quicktime 7.4.5.67 wait C:\WINDOWS\system32\msiexec.exe /uninstall  
{
{1838C5A2-AB32-4145-85C1-BB9B8DFA24CD
} /passive   elseif (exists keys whose (value 
"DisplayVersion" of it = 
"7.4.1.14") of key 
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) then 
//uninstall quicktime 7.4.1.14 wait C:\WINDOWS\system32\msiexec.exe /uninstall  
{
{BFD96B89-B769-4CD6-B11E-E79FFD46F067
} /passive   elseif (exists keys whose (value 
"DisplayVersion" of it = 
"7.4.0.91") of key 
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) then 
//uninstall quicktime 7.4.0.91 wait C:\WINDOWS\system32\msiexec.exe /uninstall  
{
{6EC874C2-F950-4B7E-A5B7-B1066D6B74AA
} /passive   elseif (exists keys whose (value 
"DisplayVersion" of it = 
"7.0.3") of key 
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) then 
//uninstall quicktime 7.0.3 wait C:\PROGRA~1\COMMON~1\INSTAL~1\Driver\11\INTEL3~1\IDriver.exe /M 
{
{3868A8EE-5051-4DB0-8DF6-4F4B8A98D083
} /uninst /s   elseif (exists keys whose (value 
"DisplayVersion" of it = 
"7.3.1.70") of key 
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) then 
//uninstall quicktime 7.3.1.70 wait C:\WINDOWS\system32\msiexec.exe /uninstall  
{
{E0D51394-1D45-460A-B62D-383BC4F8B335
} /passive   elseif (exists keys whose (value 
"DisplayVersion" of it = 
"7.3.0.70") of key 
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) then 
//uninstall quicktime 7.3.0.70 wait C:\WINDOWS\system32\msiexec.exe /uninstall  
{
{9763E36A-08E9-4228-BBCE-12989A4EB1A8
} /passive   elseif (exists keys whose (value 
"DisplayVersion" of it = 
"7.2.0.240") of key 
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) then 
//uninstall quicktime 7.2.0.240 wait C:\WINDOWS\system32\msiexec.exe /uninstall  
{
{95A890AA-B3B1-44B6-9C18-A8F7AB3EE7FC
} /passive   elseif (exists keys whose (value 
"DisplayVersion" of it = 
"7.1.6.200") of key 
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) then 
//uninstall quicktime 7.1.6.200 wait C:\WINDOWS\system32\msiexec.exe /uninstall  
{
{08094E03-AFE4-4853-9D31-6D0743DF5328
} /passive   elseif (exists keys whose (value 
"DisplayVersion" of it = 
"7.1.5.120") of key 
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) then 
//uninstall quicktime 7.1.5.120 wait C:\WINDOWS\system32\msiexec.exe /uninstall  
{
{5E863175-E85D-44A6-8968-82507D34AE7F
} /passive   elseif (exists keys whose (value 
"DisplayVersion" of it = 
"7.1.3.100") of key 
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) then 
//uninstall quicktime 7.1.3.100 wait C:\WINDOWS\system32\msiexec.exe /uninstall  
{
{F07B861C-72B9-40A4-8B1A-AAED4C06A7E8
} /passive   elseif (exists keys whose (value 
"DisplayVersion" of it = 
"7.1") of key 
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) then 
//uninstall quicktime 7.1 wait C:\PROGRA~1\COMMON~1\INSTAL~1\Driver\11\INTEL3~1\IDriver.exe /M 
{
{C21D5524-A970-42FA-AC8A-59B8C7CDCA31
} /uninst /s   elseif (exists keys whose (value 
"DisplayVersion" of it = 
"7.0.4") of key 
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) then 
//uninstall quicktime 7.0.4 wait C:\PROGRA~1\COMMON~1\INSTAL~1\Driver\11\INTEL3~1\IDriver.exe /M 
{
{929408E6-D265-4174-805F-81D1D914E2A4
} /uninst /s   elseif (exists keys whose (value 
"DisplayVersion" of it = 
"7.0.3") of key 
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) then 
//uninstall quicktime 7.0.3 wait C:\PROGRA~1\COMMON~1\INSTAL~1\Driver\11\INTEL3~1\IDriver.exe /M 
{
{0B69DA57-BC7D-461D-B7D6-2AA9F08869CD
} /uninst /s   elseif (exists keys whose (value 
"DisplayVersion" of it = 
"7.0.2") of key 
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of registry) then 
//uninstall quicktime 7.0.2 wait C:\PROGRA~1\COMMON~1\INSTAL~1\Driver\11\INTEL3~1\IDriver.exe /M 
{
{7A8658B8-174E-498E-86CF-F2A40B21F579
} /uninst /s   endif