Mapped Drive asking for Password

Questions about file sharing through NFS/CIFS/AFP? Post it here!
Forum rules
This is a user forum for Synology users to share experience/help out each other: if you need direct assistance from the Synology technical support team, please use the following form:
https://myds.synology.com/support/suppo ... p?lang=enu

Postby int15 » Wed Jan 31, 2007 7:40 pm

I created a batch file called: "c:\mapdrives.bat" with a line:
net use E: \\DiskStation\Web /user:DiskStation\username password

note: Diskstation refers to the DS106e's name (it can also be the IP address)

In the windows registry I then added a string value called: "map drives" in: HKEY_Local_Machine\Software\Microsoft\Windows\CurrentVersion\Run and gave it a value of: "c:\mapdrives.bat"


Instead of modifying the registry, one could also add a shortcut to the command file in the Startup folder. I came across the same problem and used this solution. Since then, it maps the drive perfectly.

Note: You might want to add the "@echo off" on the first line of the mapdrives.bat, to prevent the login/pass from being displayed.
Synology Model: DS-101j
Firmware Version: 2.0.3 - 0640
User avatar
int15
Student
Student
 
Posts: 66
Joined: Mon Dec 04, 2006 12:01 am

Postby imran.maz » Wed Mar 21, 2007 1:11 pm

Hey guys,

I havent tried this stuff yet, but for good reason.

I use my DS-106e as a repsitory for my Utorrent downloads (i will mod my DS next week to have a new bittorrent client!)

Utorrent starts up automatically but cannot find the drive and so puts red crosses next to the files and stops downloading.

When you go to "my computer" and double click on the z:/ drive (synology drive) it opens up and then if you click start on the files in Utorrent they can now connect to the drive.

Utorrent then checks the files for consistency before it downloads... when files are 9GB in size this takes forever!!

Will this code abouve fix this probem? I dont want to test it and have utorrent check thru 54GB of files!!
Formerly:
Synology DS-106e
Seagate Barracuda 320GB Drive
Firmware 428
imran.maz
Apprentice
Apprentice
 
Posts: 91
Joined: Thu Mar 01, 2007 12:25 pm
Location: London, UK

Postby imran.maz » Thu Mar 22, 2007 11:25 am

Ok,

I fixed the problem i had. here is my code:

@echo off
PING 127.0.0.1 -n 6
start z:\utorrentShortcut


the ping will fail six times giving the DS-106e time to "almost" map.
then calling a shortcut of the program you are trying to open from the DS-106e wakes the connection up and then the program can start accessing information on the drive without you clicking on the drive icon to wake the connection.

I then dragged the mapdrives.bat file into the folder in:
start>all programs>startup

it works a charm!
Formerly:
Synology DS-106e
Seagate Barracuda 320GB Drive
Firmware 428
imran.maz
Apprentice
Apprentice
 
Posts: 91
Joined: Thu Mar 01, 2007 12:25 pm
Location: London, UK

Postby rcollings » Sat Apr 28, 2007 5:06 pm

Franklin wrote:So, once you have figured out what your user name is, you'll have to create an account on the Synology server which has the same name as the name identified by that guide that I provided.
On the basis of my testing, I think this is 100% wrong!

Here's why...

I had a problem with having to log into my mapped drives on a new (in fact very old) machine that I had set up to access my DS106e. I was having to log into the drives each time I logged into the machine. I didn't have this problem on other machines.

A key point here is that the machine in question is an XP Home (SP1) system.

Without going into all the detail, I couldn't get the above approach to work.

However, I did end up with a situation that would appear to demonstrate why the above is statement is incorrect....

On the PC:
* Welcome user name = "Richard C"
* User name shown in the SET command = "Richard Collings"

On the Synology:
* User name = "Richard"

I set the two accounts to have the same password.

I had previous set a mapped drive using the Synology user id ("Richard") and its associated password.

When I log in again - I got a "Cannot connect to mapped drive" msg and on clicking on the drive in question, I get the user id/password dialog showing the following value in the UserId: "\\Diskstation\Richard"

ie: Windows is trying to reestablish the connection using the user id that I had originally connected to the drive with; it was not using either the Welcome User id or the XP User id for that user on that machines. This matches my recollections of setting up the Synology on other machines - the user id used to connect to the Synology did not not need to match the Windows user id for a successul connection to be established.

I think the underlying cause of the problem is that XP Home does not permit the storage of network user credentials (there is no 'Remember password' tick box on the log in when setting up the network drive). There may be a work around for this but if there is, I can't find it.

However, the good news is that there is another (obvious) solution - use the Synology Assistant (V2.0-3.428) to do the mapping.

I don't know how it achieves it but on first test (at least), after setting up the mapping, logging out and logging back in again, I was able to access the drive immediately without needing to log in.

The only downside is that the server is represented by its IP address rather than its name.
rcollings
Rookie
Rookie
 
Posts: 33
Joined: Wed Nov 29, 2006 2:35 pm

set user password in Windows for automatic reconnect

Postby groofy » Mon Jul 30, 2007 6:04 pm

I've struggled a while with this problem too ... until I saw the difference between my 2 pc's connected to my DS107e.

On one pc the automatic reconnect at logon worked perfectly, the other asked for passwords each time I wanted to open a mapped drive.

The difference was that on the one pc, I had to logon the user in Windows, on the other pc I could just click a user in the Welcome screen and startup Windows.

So, obvious solution here ... set the same user and password (as you did in the privileges for the disk station) in Windows. The password is the clue here ! Windows will remember that password for opening the mapped drives.
groofy
I'm New!
I'm New!
 
Posts: 3
Joined: Sat Jul 28, 2007 9:37 am

Re: Mapped Drive asking for Password

Postby mortandr » Thu Apr 17, 2008 10:15 pm

In order to avoid the logon prompt when accessing files on my DS207+, I tried to use my windows USERNAME as an accountname.
BUT since my USERNAME in windows (found by using the command prompt CMD+SET) is "BERTLIN & ANDREASEN", its simply not possible to create an account name on the DS including the "and" sign.

Ive searched windows xp forums in order to find out how to change the USERNAME in windows, but with little luck. Does anyone know how to do that ?
mortandr
I'm New!
I'm New!
 
Posts: 2
Joined: Mon Apr 14, 2008 3:13 pm

Re: Mapped Drive asking for Password

Postby RangerFish » Fri Apr 18, 2008 4:29 pm

That depends where that user is defined. I'm going to assume it's defined locally.

  1. Open the Windows Control Panel
  2. Double click Administrative Tools, then Computer Managment
  3. In the management window, navigate to System Tools > Local Users and Groups > Users.
  4. Right click the user in the list, and select rename. You'll be able to edit the name. Choose something with just letters, numbers and underscores ('_'). bna would be good, or if you're masochistic ( :) ), BERTLIN_AND_ANDREASEN.
  5. Log off or reboot your PC, then log back on again. Do the CMD+SET check again, and your username should have been changed.

If it's a domain user, then means mucking about with the ADS Users and Computers applet.

Hope that helps

John
RangerFish
Novice
Novice
 
Posts: 51
Joined: Wed Mar 05, 2008 4:13 pm

Re: Mapped Drive asking for Password

Postby eric.s » Thu Jul 17, 2008 6:37 pm

I know what you guys are facing. A lot of people from my office have similar problems although the folders are already mapped into your computers. Sometimes, those drives get disconnected because SynoBox is down or something happends to their network connections. Then I have to go around and map the drives again. So I wrote this VB script to make my life and their lives a bit easier. Just save the file with .vbs extension.

'----------------------------------------------------------------------------------------'
' map_drives.vbs
' VBScript to map a network drive with multiple variables.
' Author: Me
'Note: Copy and paste the code into notepad or any text editing software
'And save it as visual basic file e.g mapDrives.vbs
' ---------------------------------------------------------------------------------------'
Option Explicit
Dim objNetwork
Dim strDriveLetter, strUser, strPassword, strProfile
Dim strRemotePath1, strRemotePath2, strRemotePath3

' variables

strDriveLetter = "X:"
strDriveLetter = "Y:"
strDriveLetter = "Z:"
strRemotePath1 = "\\yourSynoBoxIP\folder1"
strRemotePath2 = "\\yourSynoBoxIP\folder2"
strRemotePath3 = "\\yourSynoBoxIP\folder3"

' User name & passwd - provide the actual user & passwd to login

strUser = "test"
strPassword = "testing123"
strProfile = "false"

' Map Network Drives

Set objNetwork = WScript.CreateObject("WScript.Network")

'Drive X:"
objNetwork.MapNetworkDrive strDriveLetter1, strRemotePath1, _
strProfile, strUser, strPassword

'Drive Y:
objNetwork.MapNetworkDrive strDriveLetter2, strRemotePath2, _
strProfile, strUser, strPassword

'Drive Z:
objNetwork.MapNetworkDrive strDriveLetter3, strRemotePath3, _
strProfile, strUser, strPassword

' Message Box
WScript.Echo " Launch Explorer, Done Mapping Drives"

'The end
WScript.Quit

'You can change the number of drives you want to map.

Good luck!
eric.s
Trainee
Trainee
 
Posts: 16
Joined: Wed Mar 05, 2008 5:18 am
Location: Canada

Re: Mapped Drive asking for Password

Postby HarryPotter » Thu Jul 17, 2008 7:41 pm

nice script, well done eric.s

just a small correction: you should numbering strDriveLetter (1, 2 and 3) and define the 3 variables at the beginning (as for strRemotePathX)

And a question: is it possible to include configuration of the name of the mapped drives?

Could you add this script to the synology wiki?

Thanks
*Please do not Private Message me for support questions; leave it on the forum so all members can learn. Thanks!*

DS712+ / DSM 4.2 3211 / 2 x HD204UI (RAID0) / LMS 7.7.2-007
DS110+ / DSM 4.2 3211 / HD154UI
DS408 / DSM 4.0 2228 / 3 x ST31000340AS (RAID0) + 1 x HDS721010KLA330
DS207+ / DSM 3.1.1636 / ST31000340AS + WD5000KS
DS-106x / DSM 4.0 2228 (from DS108j) /

2 Squeezebox 3 + Boom
Rapsody N35

APC Smart UPS SUA750i
User avatar
HarryPotter
Honorary Moderator
Honorary Moderator
 
Posts: 12330
Joined: Mon Oct 23, 2006 12:48 pm
Location: Switzerland

Re: Mapped Drive asking for Password

Postby eric.s » Thu Jul 17, 2008 11:19 pm

Well, HarryPotter, I guess I could make the code a bit more compact. But as far as the veriable names are concerned, you can change it to anything you want. The code works just fine as it is. However, if changing veriable names makes more sense to you, you are welcome to do it. After all, that's just a sample script so that people can tweak it to their needs.

I am not sure what you mean by "include configuration of the name of the mapped drives".

Once you run (double click) the script, all the drives that you want to map are mapped to your computer and the name(s) of the drive(s) are already included in the RemotePath. Say, if the remote patch is "//private/Movies" and the drive letter is "X", then you will see "Movies on private X:" in your "My Computer".

But if you mean to say that you want to see the letter of the mapped drives, I guess you could add this in the "Message Box" like this:

' Extra code just to add drive name and letter
WScript.Echo "Your Drive1 name" & strDriveLetter1 & " Your Drive2 name " & strDriveLetter2 & "Your Drive3 name" &strDriveLetter3

That should come up with a message box with drive letter and corresponding drive name.

As for the wiki, I sure could post it there if I am allow to do so.

I hope that answers your questions.
eric.s
Trainee
Trainee
 
Posts: 16
Joined: Wed Mar 05, 2008 5:18 am
Location: Canada

Re: Mapped Drive asking for Password

Postby HarryPotter » Fri Jul 18, 2008 8:14 am

no, the script does NOT work as it is written above (it returns the error that strDriveLetter1 is not defined, what is correct)

Dim strDriveLetter should be : DIM strDriveLetter1, strDriveLetter2, strDriveLetter3

' variables

strDriveLetter = "X:" should be : strDriveLetter1 = "X:"
strDriveLetter = "Y:" should be : strDriveLetter2 = "Y:"
strDriveLetter = "Z:" should be : strDriveLetter3 = "Z:"

....

'Drive X:"
objNetwork.MapNetworkDrive strDriveLetter1, strRemotePath1, _
strProfile, strUser, strPassword

'Drive Y:
objNetwork.MapNetworkDrive strDriveLetter2, strRemotePath2, _
strProfile, strUser, strPassword

'Drive Z:
objNetwork.MapNetworkDrive strDriveLetter3, strRemotePath3, _
strProfile, strUser, strPassword

then you will see "Movies on private X:"

Yes, thats what I mean, I prefer to see "Movies" (without the rest)
*Please do not Private Message me for support questions; leave it on the forum so all members can learn. Thanks!*

DS712+ / DSM 4.2 3211 / 2 x HD204UI (RAID0) / LMS 7.7.2-007
DS110+ / DSM 4.2 3211 / HD154UI
DS408 / DSM 4.0 2228 / 3 x ST31000340AS (RAID0) + 1 x HDS721010KLA330
DS207+ / DSM 3.1.1636 / ST31000340AS + WD5000KS
DS-106x / DSM 4.0 2228 (from DS108j) /

2 Squeezebox 3 + Boom
Rapsody N35

APC Smart UPS SUA750i
User avatar
HarryPotter
Honorary Moderator
Honorary Moderator
 
Posts: 12330
Joined: Mon Oct 23, 2006 12:48 pm
Location: Switzerland

Re: Mapped Drive asking for Password

Postby eric.s » Fri Jul 18, 2008 4:16 pm

Oh...my bad...

I didn't check the "Mapping Drive" part. You do not have to use three variables. I mistakenly put the wrong variable in the "Mapping Drive" part. You can just have only one variable for drive letter - strDriveLetter.

All you need to do is to "Remove" the numbers from strDriveLetter as follow:

strDriveLetter1 --> strDriveLetter (Make the change in Map Drive script)
strDriveLetter2 --> strDriveLetter (Make the change in Map Drive script)
strDriveLetter3 --> strDriveLetter (Make the change in Map Drive script)

'Drive X:
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath1, _
strProfile, strUser, strPassword

'Drive Y:
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath2, _
strProfile, strUser, strPassword

'Drive Z:
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath3, _
strProfile, strUser, strPassword

Then it will compile and run without a hitch.

If you just want to see only the folder name without the rest, you could rename the drive using the script. But if you want to do that, it’s a good idea to have three variables for strDriveLetter to make things clearer.

Here is how:

'----------------------------------------------------------------------------------------'
' map_drives.vbs v.2.0
' VBScript to map a network drive with multiple variables.
' Author: Me
' Note: Copy and paste the code into notepad or any text editing software
' And save it with .vbs extension e.g map_drives.vbs
' ---------------------------------------------------------------------------------------'
Option Explicit

' variables
Dim objNetwork
Dim strDriveLetter1, strDriveLetter2, strDriveLetter3, strUser, strPassword, strProfile
Dim strRemotePath1, strRemotePath2, strRemotePath3
Dim strReNameX, strReNameY, strReNameZ

' Assign Drive Letter and path

strDriveLetter = "X:"
strRemotePath1 = “\\yourSynoBoxIP\folder1”
strReNameX = “Movie”

strDriveLetter = "Y:"
strRemotePath2 = “\\yourSynoBoxIP\folder2”
strReNameY =”Music”

strDriveLetter = "Z:"
strRemotePath3 = "\\yourSynoBoxIP\folder3"
strReNameZ = “Pictures”

' User name & passwd - provide the actual user & passwd to login

strUser = "test"
strPassword = "testing123"
strProfile = "false"

' Map Network Drives

Set objNetwork = WScript.CreateObject("WScript.Network")

'Drive X:"
objNetwork.MapNetworkDrive strDriveLetter1, strRemotePath1, _
strProfile, strUser, strPassword

‘ Rename Mapped Drive X
Set objShell = CreateObject("Shell.Application")
objShell.NameSpace(strDriveLetter1).Self.Name = strReNameX

'Drive Y:
objNetwork.MapNetworkDrive strDriveLetter2, strRemotePath2, _
strProfile, strUser, strPassword

‘ Rename Mapped Drive Y
Set objShell = CreateObject("Shell.Application")
objShell.NameSpace(strDriveLetter2).Self.Name = strReNameY

'Drive Z:
objNetwork.MapNetworkDrive strDriveLetter3, strRemotePath3, _
strProfile, strUser, strPassword

‘ Rename Mapped Drives Z
Set objShell = CreateObject("Shell.Application")
objShell.NameSpace(strDriveLetter3).Self.Name = strReNameZ

' Message Box
WScript.Echo "Done Mapping Drives"

'The end
WScript.Quit

That should rename the folder name to whatever you want it to be and it should only show that name as Map Drive in "My Computer".

Try that and let me know if it works.
eric.s
Trainee
Trainee
 
Posts: 16
Joined: Wed Mar 05, 2008 5:18 am
Location: Canada

Re: Mapped Drive asking for Password

Postby HarryPotter » Sat Jul 19, 2008 12:31 am

Thanks for your effort.

Now I get the following Microsoft VBScript compilation error:

Row: 19
Character: 18
Error: Invalid character
Code: 800A0408
*Please do not Private Message me for support questions; leave it on the forum so all members can learn. Thanks!*

DS712+ / DSM 4.2 3211 / 2 x HD204UI (RAID0) / LMS 7.7.2-007
DS110+ / DSM 4.2 3211 / HD154UI
DS408 / DSM 4.0 2228 / 3 x ST31000340AS (RAID0) + 1 x HDS721010KLA330
DS207+ / DSM 3.1.1636 / ST31000340AS + WD5000KS
DS-106x / DSM 4.0 2228 (from DS108j) /

2 Squeezebox 3 + Boom
Rapsody N35

APC Smart UPS SUA750i
User avatar
HarryPotter
Honorary Moderator
Honorary Moderator
 
Posts: 12330
Joined: Mon Oct 23, 2006 12:48 pm
Location: Switzerland

Re: Mapped Drive asking for Password

Postby eric.s » Sat Jul 19, 2008 6:42 am

Ok. I noticed that I forgot to put the variable in the beginning - objShell. Sorry about that. The trouble is that I never actually compile and run the scrip I put on this forum. Anyhow, the following is the script I wrote for myself and I have just run and tested it. It works just fine for me.
' ----------------------------------------------------------------------'
' connect_drives.vbs
' Author: Me
' ----------------------------------------------------------------------'
Option Explicit
Dim objNetwork, objShell
Dim strDriveLetter1, strDriveLetter2, strDriveLetter3, strUser, strPassword, strProfile
Dim strReNameX, strReNameY, strReNameZ
Dim strRemotePath1, strRemotePath2, strRemotePath3

' Set variables

' Drive X
strDriveLetter1 = "X:"
strRemotePath1 = "\\172.0.0.1\Maps"
strReNameX = "Maps"

' Drive Y
strDriveLetter2 = "Y:"
strRemotePath2 = "\\172.0.0.1\Files"
strReNameY = "Private"

' Drive Z
strDriveLetter3 = "Z:"
strRemotePath3 = "\\172.0.0.1\public"
strReNameZ = "Public Files"

' User name and passwd
strUser = "me"
strPassword = "1234"
strProfile = "false"

' Set Network
Set objNetwork = WScript.CreateObject("WScript.Network")

' Map Drive X
objNetwork.MapNetworkDrive strDriveLetter1, strRemotePath1, _
strProfile, strUser, strPassword

' Rename Drive X
Set objShell = CreateObject("Shell.Application")
objShell.NameSpace(strDriveLetter1).Self.Name = strReNameX

'Map Drive Y
objNetwork.MapNetworkDrive strDriveLetter2, strRemotePath2, _
strProfile, strUser, strPassword

' Rename Drive Y
Set objShell = CreateObject("Shell.Application")
objShell.NameSpace(strDriveLetter2).Self.Name = strReNameY

' Map Drive Z
objNetwork.MapNetworkDrive strDriveLetter3, strRemotePath3, _
strProfile, strUser, strPassword

' Rename Drive Z
Set objShell = CreateObject("Shell.Application")
objShell.NameSpace(strDriveLetter3).Self.Name = strReNameZ

' Message Box - Note the following is only one line
WScript.Echo "Done connecting to " & " Maps on " & strDriveLetter1 & " Private Files on " & strDriveLetter2 & " Public Files on " & strDriveLetter3

WScript.Quit
eric.s
Trainee
Trainee
 
Posts: 16
Joined: Wed Mar 05, 2008 5:18 am
Location: Canada

Re: Mapped Drive asking for Password

Postby HarryPotter » Sat Jul 19, 2008 10:54 am

Now its perfect, thank you :)
*Please do not Private Message me for support questions; leave it on the forum so all members can learn. Thanks!*

DS712+ / DSM 4.2 3211 / 2 x HD204UI (RAID0) / LMS 7.7.2-007
DS110+ / DSM 4.2 3211 / HD154UI
DS408 / DSM 4.0 2228 / 3 x ST31000340AS (RAID0) + 1 x HDS721010KLA330
DS207+ / DSM 3.1.1636 / ST31000340AS + WD5000KS
DS-106x / DSM 4.0 2228 (from DS108j) /

2 Squeezebox 3 + Boom
Rapsody N35

APC Smart UPS SUA750i
User avatar
HarryPotter
Honorary Moderator
Honorary Moderator
 
Posts: 12330
Joined: Mon Oct 23, 2006 12:48 pm
Location: Switzerland

PreviousNext

Return to File Sharing: Windows, Mac OS X, Linux

Who is online

Users browsing this forum: No registered users and 2 guests