Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Map network drive

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,30858
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Map network drive
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Map network drive - 2/9/2006 3:05:48 AM   
  zwap

 

Posts: 10
Score: 0
Joined: 2/9/2006
Status: offline
My scripts doesn 't work.

I want to map network drives, for the users

this is my script:


      


This rule does not work:
objNetwork.MapNetworkDrive "F:", \users\" target=_blank>\\<servername>\users\

\\<servername>\users\
On the server is a folder named: test (\users\test" target=_blank>\\<servername>\users\test)
I create a user in the AD named: test
Domain: biezegroep.net

What I want is: to map een networkdrive to this folder.

Please help!!!

< Message edited by zwap -- 2/9/2006 10:44:14 PM >
 
 
Post #: 1
 
 RE: Map network drive - 2/9/2006 3:22:05 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
What value should ??USER?? have?

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to zwap)
 
 
Post #: 2
 
 RE: Map network drive - 2/9/2006 3:29:52 AM   
  zwap

 

Posts: 10
Score: 0
Joined: 2/9/2006
Status: offline
quote:

ORIGINAL: ebgreen

What value should ??USER?? have?


The user dat logged in. this script will be used for an network connection to a personal folder on the server.

(in reply to ebgreen)
 
 
Post #: 3
 
 RE: Map network drive - 2/9/2006 3:41:17 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
Well, there are several ways to get the currently logged on user. Search the forum then post back here if you have a problem with what you find.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to zwap)
 
 
Post #: 4
 
 RE: Map network drive - 2/9/2006 8:18:24 PM   
  zwap

 

Posts: 10
Score: 0
Joined: 2/9/2006
Status: offline
That is the problem.

I search on the internet but I did 'nt find it.

On the server I have a Share: Users

\users\">\\<servername>\users\

In this folder are subfolders.
The name of the subfolders are equal on the username.

What I want is een script, that map a network drive on his folder.

Can you help?

(in reply to ebgreen)
 
 
Post #: 5
 
 RE: Map network drive - 2/9/2006 8:19:32 PM   
  zwap

 

Posts: 10
Score: 0
Joined: 2/9/2006
Status: offline
quote:

ORIGINAL: ebgreen

Well, there are several ways to get the currently logged on user. Search the forum then post back here if you have a problem with what you find.


But what is the variable command in VBS?

This command doesnt work:
objNetwork.MapNetworkDrive "F:", "\\<servername>\users\& strUserDN

< Message edited by zwap -- 2/9/2006 10:41:29 PM >

(in reply to ebgreen)
 
 
Post #: 6
 
 RE: Map network drive - 2/10/2006 3:02:02 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
I searched this forum for 'map drive username' and found a plethora of threads addressing your specific issue. This thread was the first result, but the second result:

http://www.visualbasicscript.com/m_29405/mpage_1/key_map%2cdrive%2cusername/tm.htm#29444

has a perfect example of how to get the username and assign it to a variable.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to zwap)
 
 
Post #: 7
 
 RE: Map network drive - 3/9/2006 5:45:00 PM   
  zwap

 

Posts: 10
Score: 0
Joined: 2/9/2006
Status: offline
The new script


      

AND my new problem:

'Outlook
Const sOrgFile = "c:\documents and settings\%username%\Outlook.txt"

If IsFile(sOrgFile) Then


   'Nothing
Else
   WshShell.Run "OUTLOOK.EXE /importprf \\biezegroep.net\sysvol\BIEZEGROEP.NET\scripts\Neptunus\Inlog\NPoutlook.prf" ,True
   On Error Resume Next

End If


What i want is:

When a user loged in this script look on his documents and settings folder if the "outlook.txt" file exist.

If this file exist then there is nothing to do...
if this file not exist then must the outlook profile be installed... and there must be created a "outlook.txt" in c:\ documents and settings\%username%\


Can you help?


Thanks

(in reply to ebgreen)
 
 
Post #: 8
 
 RE: Map network drive - 3/9/2006 10:05:18 PM   
  Cybex


Posts: 412
Score: 0
Joined: 9/14/2005
From: Florida
Status: offline
Are you trying to setup first time users and /or users w/ roaming profiles?  If so try this.


      


Cybex

_____________________________

Common sense is not so common.

(in reply to zwap)
 
 
Post #: 9
 
 RE: Map network drive - 3/9/2006 11:50:44 PM   
  zwap

 

Posts: 10
Score: 0
Joined: 2/9/2006
Status: offline
THANKS!!!


      

Can you help me with this:

When the network drive exist then he must be disconected!

and can you look at my script if it is a good script?????

Thanks in advance!!

(in reply to Cybex)
 
 
Post #: 10
 
 RE: Map network drive - 3/10/2006 4:43:25 AM   
  Cybex


Posts: 412
Score: 0
Joined: 9/14/2005
From: Florida
Status: offline
At just a quick look, it looks good.  I think you set "objNetwork" twice as well as "objFSO".  Once you set it you can use it over and over even for other actions.  I don't have time to look at it right and you only have a few options so no big deal but you might see if you couldn't do a "For Each" loop and/or a "Select Case"  statement to cut down the "If" statements on the drive mapping.  All in all pretty good.


Cybex

_____________________________

Common sense is not so common.

(in reply to zwap)
 
 
Post #: 11
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Map network drive Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts