Isn't that what objShell.exec does in vbscript? Of course, stick something like the following in .bashrc
Code:
if ((wc $SSH_TTY)); then
touch ssh_exist
fi
and have a script remove it at logout/ garbage collection. Then read the file in vbscript, and catch the file exception. This is, to be honest, the way you probably shouldn't do it- but in a purely bash solution...