Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Map drive on logon

Featured Replies

Hello everyone, I have a little problem.

I'm working in a 2000/xp environnement with a windows 2003 server running Active Directory. Now when user logon, there home directory automaticly map to Z. But I have 2 more drive to map so I made a little script for that:

Set objSysInfo = CreateObject("ADSystemInfo")
Set objNetwork = CreateObject("Wscript.Network")

objUsername = objSysInfo.UserName
objUserName = replace(objUsername,"\","")
objUserName = replace(objUsername,"CN=","")
strUsername = split(objUsername,",",3)
strUser = strUsername(0) + ", " + strUsername(1)
Wscript.Echo strUser

strPublic = "\\srvfich1\Public\" + strUser
strDepot = "\\srvfich1\Depot\" + strUser

Wscript.echo strPublic
Wscript.echo strDepot


objNetwork.MapNetworkDrive "w:", strPublic
objNetwork.MapNetworkDrive "x:", strDepot

While it work fine, the problem I have is that most of users have spaces in the drive to map (like \\srvfich1\Public\Raoul, Alfonse). because of the space, it then try to map "\\srvfich1\Public\Raoul,".

Do you have any way arround this? I can't rename the folder so it have to map to this name.

Thanks

  • Author

Fixed it myself. I cleaned up the code and put some comments, but it's in french (sorry, for a french environnement)

'########################################################################################
'# #
'# Script: Map Drive Depot Public #
'# Auteur: Jean-Sébastien Frenette #
'# Système: Active Directory #
'# Description: Va chercher le full name sur AD de l'usagé connecté et map #
'# Depot sur "x:" et Public sur "w:" #
'########################################################################################



'On crée les connections vers le système
Set objSysInfo = CreateObject("ADSystemInfo")
Set objNetwork = CreateObject("Wscript.Network")

'On va chercher le fullpath du user connecté
objUsername = objSysInfo.UserName

'On enlève le \ devant la ,
objUserName = replace(objUsername,"\","")

'On enlève le CN=
objUserName = replace(objUsername,"CN=","")

'On split en 3 partit, lastname/firstname/lereste
strUsername = split(objUsername,",",3)

'On set les noms des mappings
'Trim est TRÈS IMPORTANT, sinon le mapping marche pas (caractère non imprimable donc invisble)
strPublic = "\\srvfich1\Public\" + trim(strUsername(0)) + ", " + trim(strUsername(1))
strDepot = "\\srvfich1\Depot\" + trim(strUsername(0)) + ", " + trim(strUsername(1))

'On map les drives
objNetwork.MapNetworkDrive "w:", strPublic
objNetwork.MapNetworkDrive "x:", strDepot

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.