net use batch file, can I include password?
My PC Hell Forum
November 19, 2008, 09:55:55 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Moving to New Location Soon! Watch out for notification. 14th Dec 2007.
 
   Home   Help Search Calendar Login Register  
Pages: [1]
  Print  
Author Topic: net use batch file, can I include password?  (Read 2042 times)
bobmad
Contributor
**
Posts: 34


View Profile
« on: March 02, 2007, 03:31:57 PM »

I use the old DOS style net use command to map drive from one computer to another.

net use {drive letter}: \\{IP Address of machine}\{folder}

to map a LOT of drives. 

I would LOVE to be able to automate the user name/password part also....

anybody know how or have any ideas?
Logged
windowsxp550
Administrator
******
Posts: 932



View Profile WWW
« Reply #1 on: March 04, 2007, 02:33:28 PM »

Some more info please...

When mapping drives it only asks  you for a username and password if you are currently logged in with a username that does not currently have access to that particular network drive.   

So how are you mapping drives?

If you were to create, say, a username with access to everything, and use that when you were mapping drives, then it wouldn't ask you for a username and password.
Logged

TAGGING!!!  New Feature Added to FixMyXP!

Click HERE to Read all about it
bobmad
Contributor
**
Posts: 34


View Profile
« Reply #2 on: March 05, 2007, 08:39:06 AM »

The computer gets moved around and connects from various locations, so it is not always able to log in to the network.  I have a VPN setup so I can get to the drives remotely, but by that time the user name password verification is over and I'm prompted for a user name password.

I recently shared this setup with a ....less competent user... (diplomacy at work) and had to spend 2 hours trying to help them get access to these drives.  They have router setup wrong, so we had to bypass it.  Then they had the standby button pressed on their modem (so it was not connecting to internet and rejecting all traffic).  I had to call their ISP to find this out.    Then we got the VPN to connect but mapping WOULD not work.

Gave up on this, tried to set them back up as they were.  1 1/2 hours latter they found out caps lock was on and I was contemplating homicide (yes I asked 4-5 times before this about the caps lock key).  So mapping issue was most likely the caps lock key.  I have no choice but to help them with this so advising them to "take a leap" is NOT an option for me.


I expect MANY more issues like this from them in the future so I was hoping someone would know how I could automate this.  They use same user name and password to logon to network as they do for their computer, BUT the mapped drives are part of a domain, not a work group.  And that is causing some of the trouble.

I do NOT expect an answer on this one.  I am HOPING for an answer or idea I can go with.

No matter how pleasing the discussion would be, advice on the homicide would NOT be helpful.

Thanks for your time
Logged
cbsarge
New FixmyXP Member
*
Posts: 1


View Profile
« Reply #3 on: March 08, 2007, 01:37:30 PM »

I have a user who uses VPN from a remote machine that is not part of our domain. The following method is what I used to build him a bat fille that he runs after connecting via the VPN.

net use \\servername\share1 password1 /user:domain\username
 
This will use your net use command to map a drive to a machine called "servername" and to a share called "share1". The user's name is "username" and the password is "password1".

Hope this helps
Logged
bobmad
Contributor
**
Posts: 34


View Profile
« Reply #4 on: March 08, 2007, 02:25:13 PM »

AWESOME dribble 
That looks like EXACTLY what I was looking for.

one note though, I use server's IP address rather than server name due to odd DNS issues that crop up over VPN.  If someone else is going to do this and they run into issues making it work try IP address rather than name.

i.e. \\192.168.1.1\users\whoever rather than \\mostawesomeserver\users\whoever for the path part of the command.


THANKS again
Logged
GrayArray
Contributor
**
Posts: 48



View Profile WWW
« Reply #5 on: June 06, 2007, 03:13:16 PM »

Just make sure you put the password in Double quotes "This is my pa$$w0rd d-_-b"

John
Logged

Gray Array, Wireless Guy
Skilled in the art of Wifi Fu
bobmad
Contributor
**
Posts: 34


View Profile
« Reply #6 on: June 06, 2007, 03:30:11 PM »

Thanks GreyArray.  Mine actually works without the quotes (I think because this user has no special characters).

When I run into one that doesn't work without quotes I'll (hopefully) remember to use the quotes.
Logged
GrayArray
Contributor
**
Posts: 48



View Profile WWW
« Reply #7 on: June 08, 2007, 03:27:51 PM »

bobmad, the quotes are mostly for command line entries of the password, and I think is mostly for encapsulating spaces and extreme special chars.

John
Logged

Gray Array, Wireless Guy
Skilled in the art of Wifi Fu
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!