LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices


Reply
  Search this Thread
Old 07-22-2010, 02:03 PM   #1
genmaicha
Member
 
Registered: Apr 2009
Posts: 38

Rep: Reputation: 15
windows question: how do I script network drive mapping w/ username/password?


Hello. in XP, how do I map a network drive via command line so that it pops up a username/password dialog (with a "remember password" option), as you would if you went to "Tools->Map Network Drive..."? "net use e: \\server\share" seems to require the username password to be kept in plain text in the .bat file.

I need to do this so I can deploy it with (non-microsoft) vpn clients to automatically setup drives when connecting. The user will not be on the same domain as the remote server (otherwise this wouldn't be a problem).

Help?
 
Old 07-23-2010, 01:21 AM   #2
zirias
Member
 
Registered: Jun 2010
Posts: 361

Rep: Reputation: 59
Hi,
If you're happy with an empty dialog, you can invoke it using rundll32:
Code:
rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL Connect
If you need the fields pre-filled, you have two possible alternatives, both involving some programming:

1. Use this win32-api-call: http://msdn.microsoft.com/en-us/libr...=VS.85%29.aspx
Either write native code (e.g. with MinGW GCC) or try P/Invoke in a .NET program.

2. Design your own Dialog (e.g. using Windows.Forms) and just launch "net use" with the parameters from this dialog -- it's all there, see "net use /help".
 
Old 07-24-2010, 01:06 AM   #3
genmaicha
Member
 
Registered: Apr 2009
Posts: 38

Original Poster
Rep: Reputation: 15
That is serious ninja-level windows knowledge, thank you sir.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mapping a windows network drive andy1974 Linux - Networking 8 02-01-2011 05:09 PM
i need to create a expect script to input username and password anurupr Linux - Newbie 5 03-22-2010 04:48 AM
How to import windows network username & password to OpenLdap aminsa Linux - Enterprise 3 07-29-2007 07:41 PM
bash script that uses username/password paul_mat Linux - Software 2 10-25-2005 10:44 PM
Mapping a network drive from Windows 2k to an ftp, Apache/1.3.27 Server DumbWindow$User General 5 04-08-2004 12:16 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 01:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration