I could solve this by changing some settings:
For windows 7
Goto Control Panel ->Network and Internet ->Network and Sharing Centre
Click on Change Advanced Sharing Settings on the left hand pane
Turn On Network Discovery, File and Printer Sharing, Public Folder Sharing
Turn off Password Protected Sharing.
This will allow other machines to access this machine with Windows 7 and also make sure the firewall is turned off.