The BAT file is probably running under a System account status. So, when the credentials are passed from your Win9x machine to the server with the shared folder, instead of your user name that you logged in with, the System credential is being presented to map the drive. And the System account on your Win9x machine does not have rigths to the shared folder.
So, add the /U: switch to the NET USE command to specify a user name and password.
For example, if the username BOB has rights on the share, and BOB has a password of "password", the NET USE line would look like this:
NET USE X: \\SERVERNAME\SHARENAME /U:BOB password
Try that in the BAT file.
hope this helps