Solved

Write a script to Map a Network Drive

Posted on 2012-03-25
7
668 Views
Last Modified: 2012-03-26
I have a laptop running Vista with all updates.  I am using a mapped network drive.  With Vista, every time I restart my computer I have to re-map the drive.  So I am looking for a way to run a script. The network drive is located on the server at my work.  The path is similar to this. I want to name the drive S: and the path is

https://myfiles.gccaz.edu/shared.  username and password is used for loggin and the box is checked for re-connect at loggin. I have attached the pdf used for a guide.
vistasdrive10sdrive.pdf
0
Comment
Question by:rangersal1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 16

Expert Comment

by:l33tf0b
ID: 37764443
you could right a batch file in notepad > rename ext from .txt to .bat and put it in your startup / logon script

net use Z: \\servername\sharename password /user:username

or just

net use  Z: \\servername\sharename

and see if it prompts you for credentials.
0
 

Author Comment

by:rangersal1
ID: 37764462
Ok I wrote the batch file and was prompted for the usernam then the password. How can I get that in the file and exactly where do I put it at in the startup script?
0
 
LVL 16

Expert Comment

by:l33tf0b
ID: 37764512
net use Z: \\servername\sharename password /user:username

are you in a domain environment or do you log on locally to your machine?

if locally, you could do this:

Create a shortcut to the batch file.
Once the shortcut has been created right-click the file and select Cut.
Click Start, Programs, right-click the Startup folder and click Open
Once the Startup folder has been opened click Edit and paste the shortcut into the startup. Any shortcuts in the startup folder will automatically start each time Windows starts.

referenced from here: http://www.computerhope.com/issues/ch000322.htm

if domain, you'll need to find out where the startup folder is kept (might not be the same).
0
The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

 

Author Comment

by:rangersal1
ID: 37764624
it keep prompting me for the user name. Here is the code:

net use S: https://myfiles.gccaz.edu/shared\gccaz\rpsalaz3/mypassword

net use S: https://myfiles.gccaz.edu/shared  is what I used with the first set of instructions.

gccaz\rpsalaz3 is my username.
0
 
LVL 81

Accepted Solution

by:
David Johnson, CD, MVP earned 500 total points
ID: 37766161
net use s: https://myfiles.gccaz.edu/shared  password /user: gccaz\rplalaz3

it must be in the format shown
net use Z: \\servername\sharename password /user:username

open notepad copy the first line into a new document
save the document as "mystartup.bat"
from explorer right click on startup.bat select create shortut
select the shortcut right click select cut
press the windows key or click on the start button
select all programs
scroll down to startup
right click and open
on a blank spot select paste
0
 

Author Comment

by:rangersal1
ID: 37766334
That was it thank you.
0
 
LVL 16

Expert Comment

by:l33tf0b
ID: 37766448
i don't see how different that was from my post... aside from substituting the actual info.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi All Just a quick one for everybody. I was recently looking into setting the default User Account Picture for all my vista clients within the network but on closer inspection the group policy setting only allows you to set the default pictur…
The main issue when installing Vista and XP in dual boot is when you have to reinstall any of the two when something fails, let's say a hard disk failure, a lost partition, virus, etc. What commonly happens is that you lose all your hard work config…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question