Not quite sure what is going on in case 1)
. Maybe the windows shell expands things in a weird way? Try hive -e "select * from sampletable"
With your second one, I'm guessing you are passing in a hdfs path for some reason. This is most certainly not what you want, as it is looking for a file in your local file system. Where is it locally?:
hive -f C:\path\to\sample.sql