Jump to content

Recommended Posts

Posted
I have some Surface RT devices and Asus Transformers. Neither can join the domain but I would like to map network drives. Mapping the drives requires the user to input a username and password to authenticate. I have used a batch file but this doesnt hide the password as it is typed. I was hoping someone may have a vb script that would allow this?
Posted
Is this a manual add, or automated? Just from your "as it's typed comment"

 

Steve

 

Manual - I want the user to login to the Surface and then click on a VB Script to run it to map the drives. Like I said I have a batch script that does this but the password is in clear text which is not ideal.

Posted

@Steve21 - Not too hot on scripts but this is what I currently have. When the user types the password it is shown on screen.

 

set /p User=Enter your three letter logon ID:

CLS

set /p Password=Enter the password you normally logon with:

CLS

 

NET USE P: "\\server\share1" /user:domain\%User% %Password%

NET USE I: "\\server\share2" /user:domain\%User% %Password%

Posted

If you don't ask it to take a password it'll automatically ask you for one, and hide the input.

 

net use Z: \\netadmin-sd1\c$ /user:"domain"\sdrew
The password is invalid for \\netadmin-sd1\c$.

Enter the password for '"domain"\sdrew' to connect to 'netadmin-sd1':
System error 1326 has occurred.

Logon failure: unknown user name or bad password.

 

Obviously wont work as I cba to put password in, but it doesn't show what I typed :)

 

Would mean you have to type it twice, if you're doing two at once though :(

 

Steve

  • Thanks 1
Posted
If you don't ask it to take a password it'll automatically ask you for one, and hide the input.

 

net use Z: \\netadmin-sd1\c$ /user:"domain"\sdrew
The password is invalid for \\netadmin-sd1\c$.

Enter the password for '"domain"\sdrew' to connect to 'netadmin-sd1':
System error 1326 has occurred.

Logon failure: unknown user name or bad password.

 

Obviously wont work as I cba to put password in, but it doesn't show what I typed :)

 

Would mean you have to type it twice, if you're doing two at once though :(

 

Steve

 

Thats done it!!! Thanks. User will have to type it twice.

Posted

i have a script on here that works. p.s. forget vbs on rt its crippled to the point of uselessness

 

echo off
rem mapdrive prompt v3 20-09-13
net use r: /delete
net use u: /delete
net use v: /delete

set /p str=Enter Username: 
rem echo %str%
set str2=%str:~0,1%
rem echo %str2%
rem echo %stra%
rem decide what year group by first character
if  %str2%==1 goto equals1
if  %str2%==2 goto equals2
if  %str2%==3 goto equals3
if  %str2%==4 goto equals4
if  %str2%==5 goto equals5
if  %str2%==6 goto equals6
if  %str2%==7 goto equals7
if  %str2%==8 goto equals8
if  %str2%==9 goto equals9
if  %str2%==0 goto equals0

rem echo not 0-9 so presumably staff

net use u: \\server\users$\staff\%str% /user:%str% *
net use r: \\server\resources$
net use v: \\server\users$

rem echo %mapu%

goto end

:equals1
net use u: \\server\users$\2011\%str% /user:%str% *
net use r: \\server\resources$

goto end

:equals2
net use u: \\server\users$\2012\%str% /user:%str% *
net use r: \\server\resources$
goto end

:equals3
net use u: \\server\users$\2013\%str% /user:%str% *
net use r: \\server\resources$
goto end

:equals4
net use u: \\server\users$\2014\%str% /user:%str% *
net use r: \\server\resources$
goto end

:equals5
net use u: \\server\users$\2015\%str% /user:%str% *
net use r: \\server\resources$
goto end

:equals6
net use u: \\server\users$\2006\%str% /user:%str% *
net use r: \\server\resources$
goto end

:equals7
net use u: \\server\users$\2007\%str% /user:%str% *
net use r: \\server\resources$
goto end

:equals8
net use u: \\server\users$\2008\%str% /user:%str% *
net use r: \\server\resources$
goto end

:equals9
net use u: \\server\users$\2009\%str% /user:%str% *
net use r: \\server\resources$
goto end

:equals0
net use u: \\server\users$\2010\%str% /user:%str% *
net use r: \\server\resources$
goto end

:end

pause

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...