NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
THN
Dec 29, 2008Aspirant
Script to Connect to Network Drive
Good Day all, I've gleaned so much information from these posts, that I thought it's time for me to contribute something, as well. So, here we go: I have created a little vbscript, which can be...
jamesd11
Jun 16, 2009Aspirant
I encountered the same problem that many users have reported about Windows not reconnecting a network drive at login. I have Windows XP Home edition, and mapped two network drives to two shares on my ReadyNAS NV+. The shares have a username that's different from the usernames on the XP box. Even though I checked the "Reconnect at logon" box, Windows would not reconnect the drives when I logged in later. According to this posting on an outside forum:
http://techrepublic.com.com/5208-6230-0.html?forumID=102&threadID=208564&messageID=2152515
XP Home edition does not cache user credentials for network resources. I confirmed this by checking the help for the "net use" command:
Apparently, this applies to other Windows editions as well. For example, the FAQ for Windows XP Media Center Edition 2005 states:
I didn't try the VBS script that THN provided above (but thanks for posting it). Instead, as a workaround, I followed Zaphod's example and created a command script:
I placed the script in All User's Startup folder so that it runs for everyone who uses the computer.
http://techrepublic.com.com/5208-6230-0.html?forumID=102&threadID=208564&messageID=2152515
XP Home edition does not cache user credentials for network resources. I confirmed this by checking the help for the "net use" command:
C:\>net help use
The syntax of this command is:
NET USE
[devicename | *] [\\computername\sharename[\volume] [password | *]]
[/USER:[domainname\]username]
[/USER:[dotted domain name\]username]
[/USER:[username@dotted domain name]
[/SMARTCARD]
[/SAVECRED]
[[/DELETE] | [/PERSISTENT:{YES | NO}]]
NET USE {devicename | *} [password | *] /HOME
NET USE [/PERSISTENT:{YES | NO}]
NET USE connects a computer to a shared resource or disconnects a
computer from a shared resource. When used without options, it lists
the computer's connections.
...
/SAVECRED Specifies that the username and password are to be saved.
This switch is ignored unless the command prompts for username
and password. This option is not available on Windows XP
Home Edition and will be ignored.
Apparently, this applies to other Windows editions as well. For example, the FAQ for Windows XP Media Center Edition 2005 states:
Can I connect a new PC running Windows XP Media Center Edition 2005 to a work network or domain?
While you can access network resources on a work network or a domain, you cannot join a Windows XP Media Center Edition 2005 PC to the domain. PCs running Windows XP Media Center Edition 2005 are designed specifically for home use. Windows XP Professional features, specifically Domain Join and Cached Credentials (Credentials Manager for logons) are not included. As a result, you will be prompted for your logon user name and password to access network resources after you reboot or log back on to the PC. ...
I didn't try the VBS script that THN provided above (but thanks for posting it). Instead, as a workaround, I followed Zaphod's example and created a command script:
C:\Documents and Settings\All Users\Start Menu\Programs\Startup>type NAS-shares.cmd
@echo off
set NASname=...
set NASuser=...
set NASpass=...
echo Setting persistence option for network drives ...
net use /persistent:no
echo Connecting network drives Z: ...
net use z: \\%NASname%\backup /user:%NASuser% "%NASpass%"
echo Connecting network drive U: ...
net use u: \\%NASname%\users /user:%NASuser% "%NASpass%"
I placed the script in All User's Startup folder so that it runs for everyone who uses the computer.
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!