• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 568
  • Last Modified:

.bat file not working to connect a drive

Good morning,
I have a .bat file containing the following code to connect a drive and it doesn't work (I changed the data for the privacy). What's wrong with that?
====================================
echo off
net use J: \\111.222.333.444\ /user:bonjour@bonjour.com MotDePasse69
J:
cls
====================================
Thanks!
0
venmarces
Asked:
venmarces
  • 3
  • 3
1 Solution
 
hlarseCommented:
looks to me like you are missing the share name here:

net use J: \\111.222.333.444\ShareName  /user:bonjour@bonjour.com MotDePasse69
0
 
venmarcesAuthor Commented:
It doesn't seem to work... The J drive doesn't appear in my browser...
0
 
hlarseCommented:
Try doing a manual mapping using windows explorer using those credentials.  If that doesn't work, it's not the batch file, it's likely security.  Also, do you have any other drives mapped to that server with different credentials?
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
venmarcesAuthor Commented:
Manual mapping works fine.
No other drive mapped to this server.
0
 
hlarseCommented:
Take out the echo off.  Insert a pause after the net use and see if it is giving you a message.
0
 
venmarcesAuthor Commented:
Ok. I found the problem...here is what I wrote:
====================================
echo off
net use J: \\111.222.333.444\ShareName\ /user:bonjour@bonjour.com MotDePasse69
J:
cls
====================================

...I put a "\" after the ShareName...

Thanks for your help!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now