Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I've written a simple login script batch file and have one problem and one question - Here's the script:
---------------
cls
@echo off
echo Authenticating %USERNAME% with %LOGONSERVER% on %USERDOMAIN%
echo Welcome %USERNAME%echo Removing existing shares/network drives...
@echo off
if exist S: net use S: /d
if exist H: net use H: /decho Now mapping network drives...
@echo off
net use S: \\svrVCG\SHARED
net use H: \\svrVCG\F$\%username%echo Login completed, have a nice day
pause
exit
---------------Now as you've probably already figured out the login script should map the S: drive to a shared directory available to everybody and the H: drive should be mapped to the user's home directory.
The login script runs and maps the first drive successfully but I always get the following:
"The password is invalid for \\svrVCG\F$\testuser" (testuser is the username and name of user's home directory)
"Type the password for \\svrVCG\F$\testuser"I then type in the users password but get:
"System error 5 has occured"
Why is this? Shouldn't the user be authenticated upon login and given access to their own directory, of which they have full control?
Can some kind person please advise me on this?
Also just out of interest, the script runs in a minimised command line prompt window... is there any way I can ensure that it is visible and normal size (or even maximised) so that the user can see any and all echo messages?
Thanks in advance
Rosco

net use...
net use doesn't pass the login password to allow access to shared resources unless it is used in the command line. (Type 'net help use' to see use of this command.) You may need to specify a different share for each folder shared and a non-variable share in the command line for net use. This could make your login-script quite long. However, if you do succeed with using separate shares and not changing your command line, then good on you.

The command I prefer to use to map the user's home folder is:
net use h: /home
I'm not sure why you are getting an error as I've used simple scripts like yours to map drives at logon without problems. Only thing I can suggest, which you've probably done, is to check the share permissions and file permissions for the folder, and verify the home directory path in the user's account.

I see your connecting to a hidden share - F$
net use H: \\svrVCG\F$\%username%
Is this a hidden share you've created or is it the default admin share created when windows is setup ?
If it's the default admin share than your users will not be able access it unless they have admin rights.
Dunno if it significant or not
Marcus

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |