x404.co.uk http://www.x404.co.uk/forum/ |
|
Network share connection batch file http://www.x404.co.uk/forum/viewtopic.php?f=4&t=16146 |
Page 1 of 1 |
Author: | DizietSma [ Mon Mar 26, 2012 10:09 am ] |
Post subject: | Network share connection batch file |
Hi all, A client's LAN, 4 PCs, all Windows Vista or 7. One of them has a shared folder on their hard drive that the others connect to which they use as their network documents folder. The LAN's too small to merit a server. To make it easy for them to connect, I leave a batch file on their desktop to allow them to connect to it. (A single double click does all , instead of having to go through [Tools > Map Network Drive] each time.) The batch file reads thus: ---- net use m: \\192.168.1.34\comun /persistent:yes explorer m: ---- For most of them it works fine every time (the PC has a fixed IP, and they know to start that machine before any others in order for it to be online to grant the mapping). However, for one of them, it often doesn't work. If their user name is [pc despacho] and their password is [crumble], to add these in to the batch file, it should read as follows, right?: ---- net use m: \\192.168.1.34\comun crumble /USER:192.168.1.34\pc despacho /persistent:yes explorer m: ---- This doesn't work though. This user does have an account on the fileshare pc, with the same username and password, and that account has both share and file permissions explicitly defined on the fileshare pc. So what's tripping it up? The space in the username? I tried adding parentheses to allow for DOS's inablity to deal with space, but no combination seems to make it work. Any ideas? Should the parentheses enclose just the "/USER:192.168.1.34\pc despacho" or the entire expression after net use? Or does it not work with spaces in usernames under DOS? Many thanks! D |
Author: | saspro [ Wed Mar 28, 2012 7:55 am ] |
Post subject: | Re: Network share connection batch file |
Can they actually access that share if they type the address in to the run command? |
Author: | DizietSma [ Wed Mar 28, 2012 3:06 pm ] |
Post subject: | Re: Network share connection batch file |
Normally, yes. Just not from time to time, which is weird. If I can add the username and password into the batch file, it should solve the problem. |
Author: | isofa [ Wed Apr 25, 2012 3:04 pm ] |
Post subject: | Re: Network share connection batch file |
Should it not be: net use m: \\192.168.1.34\comun /user:pc despacho crumble /persistent:yes or possibly: net use m: \\192.168.1.34\comun /user:"pc despacho" crumble /persistent:yes The username should be first, then a space, then the password. If you want to prompt for p/w rather than storing it use an asterisk: net use m: \\server\share /user:domain\username * |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |