end
def extractexe(command)
if command.is_a? Array
# easy case: command was quoted
command.first
if command =~ /^"([^"]+)"/
elsif match = /^"([^"]+)"|^'([^']+)'/.match(command)
$1
# extract whichever of the two sides matched the content.
match[1] or match[2]
else
command.split(/ /)[0]