Reply to topic  [ 4 posts ] 
Network share connection batch file 
Author Message
Has a life

Joined: Wed Sep 09, 2009 11:36 am
Posts: 98
Reply with quote
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

_________________
When I see religious people arguing about religion all I see is deluded people arguing about whose imaginary friend is better.


Mon Mar 26, 2012 10:09 am
Profile
Site Admin
User avatar

Joined: Thu Apr 23, 2009 5:53 pm
Posts: 8603
Location: location, location
Reply with quote
Can they actually access that share if they type the address in to the run command?

_________________
Support X404, use our Amazon link
Get your X404 tat here
jonlumb wrote:
I've only ever done it with a chicken so far, but if required I wouldn't have any problems doing it with other animals at all.


Wed Mar 28, 2012 7:55 am
Profile WWW
Has a life

Joined: Wed Sep 09, 2009 11:36 am
Posts: 98
Reply with quote
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.

_________________
When I see religious people arguing about religion all I see is deluded people arguing about whose imaginary friend is better.


Wed Mar 28, 2012 3:06 pm
Profile
Occasionally has a life

Joined: Thu Apr 08, 2010 9:52 am
Posts: 117
Location: England
Reply with quote
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 *


Wed Apr 25, 2012 3:04 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.