I guess it all depends on how you want to handle the result.
One thing to do is:
net share | find /I "c:\myfolder "
which will output one line of text if the folder is shared. If you want to
write an app to do it, then use the NetShareEnum and retrieve level 2
information and check the path on each shared folder.