apart from the fact that the amount of endif's doesn't match the amount of if's
you have a quote puzzle there:

shell "c:\dsclient.exe /c:"setup.exe /q""

should be

shell 'c:\dsclient.exe /c:"setup.exe /q"'
_________________________