Resend my activation email : Register : Log in 
BCF: Bike Chat Forums


Script to map drives

Reply to topic
Bike Chat Forums Index -> The Geek Zone
View previous topic : View next topic  
Author Message

Colin Edwards
Brolly Dolly



Joined: 06 Jul 2007
Karma :

PostPosted: 13:28 - 08 Feb 2012    Post subject: Script to map drives Reply with quote

Hi

I have a requirement for some home user machines to be able to connect to our network via VPN and map network drives. I can get all the drives mapped apart from the home directory

I have tried using the %username% variable but this doesn't work (e.g. \\server\server\%username%). It uses the account name the user has logged in with and this can be anything as its a home PC

I need some sort of script that will prompt for user name and password and then map a home directory n the username

Any suggestions?

CE
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

el_oso
World Chat Champion



Joined: 17 May 2008
Karma :

PostPosted: 14:14 - 08 Feb 2012    Post subject: Reply with quote

think you find that you may need to mess about with the security settings. i'm sure that by default windows blocks sharing of home directories. so you need to change that setting first.

sorry, but i'm too tired to really understand what is fully going on. hope this helps somewhat though.
____________________
Duke 390
Previous: '05 XR125L | '96 XJ600S Diversion |'05 Suzuki GSXR1000 | '05 Honda CBR125-R | '97 YZF 600R Thundercat | '11 Honda CBR250
Car: Jeep Wrangler 4.0L
 Back to top
View user's profile Send private message You must be logged in to rate posts

Colin Edwards
Brolly Dolly



Joined: 06 Jul 2007
Karma :

PostPosted: 14:16 - 08 Feb 2012    Post subject: Reply with quote

All settings are fine and dealt with

Just need someway to get the script to prompt for a user name and then use the username as the variable

CE
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

Colin Edwards
Brolly Dolly



Joined: 06 Jul 2007
Karma :

PostPosted: 15:33 - 08 Feb 2012    Post subject: Reply with quote

Got it:


echo "Enter Username"
set /p UserName=
echo "Password"
set /p PassWord=

net use m: "\\server\share\%USERNAME%" /User:domain\%username% %password% /PERSISTENT:NO
net use n: "\\server\share" /User:icr\%username% %password% /PERSISTENT:NO


CE
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts
Old Thread Alert!

The last post was made 14 years, 252 days ago. Instead of replying here, would creating a new thread be more useful?
  Display posts from previous:   
This page may contain affiliate links, which means we may earn a small commission if a visitor clicks through and makes a purchase. By clicking on an affiliate link, you accept that third-party cookies will be set.

Post new topic   Reply to topic    Bike Chat Forums Index -> The Geek Zone All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Read the Terms of Use! - Powered by phpBB © phpBB Group
 

Debug Mode: ON - Server: birks (www) - Page Generation Time: 0.08 Sec - Server Load: 0.85 - MySQL Queries: 16 - Page Size: 40.05 Kb