There are many ways to debug. You can use the /d parameter when starting the script but what I usually do is display some key variables on the screen by adding ?$varname just after they are set and/or modified. Adding some text might also help. If you add something like ?"Yep system name is xxxx" in the case statements you will see what case resolves to true (if any). Adding a Case 1 statement as the last Case will enable you to show or do something when all others fail. If all other case statements fail Case 1 will always be executed. Adding a sleep at the end will enable you to actually see the stuff on the screen.

A small example:
 Code:
Break on

$test = 1
? $test

$test = $test + 5
? $test

Select
	Case $test = 1
		? "Test equals 1"
		;Do stuff for 1.
	Case $test = 7
		? "Test equals 7"
		;Do stuff for 7
	Case 1
		? "All cases failed. Test equals: " + $test
		;Do stuff for everything but 1 and 7.
EndSelect

Sleep 10
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.