[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Write a script to Map a Network Drive

Posted on 2012-03-25
7
Medium Priority
?
674 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
  • 3
  • 3
7 Comments
 
LVL 16

Expert Comment

by:Raymond Peng
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:Raymond Peng
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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 84

Accepted Solution

by:
David Johnson, CD, MVP earned 2000 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:Raymond Peng
ID: 37766448
i don't see how different that was from my post... aside from substituting the actual info.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

So who is this article for? If you are like most of the computer users out there, you probably only realize the meaning of 'System maintenance' after something goes wrong. This article is for you if you care about keeping your system working opti…
When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
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…
Suggested Courses
Course of the Month19 days, 6 hours left to enroll

834 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