Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Name: ace_omega
I have a login script...
call \\10.100.100.7\scripts\mapdrives.vbs ADDPRINTERCONNECTION ("\\10.100.100.8\Fax") echo ************************************** >> \\10.100.100.8\share\loginlog.txt echo Logon %computername% %username% >> \\10.100.100.8\share\loginlog.txt date /t >> \\10.100.100.8\share\loginlog.txt time /t >> \\10.100.100.8\share\loginlog.txt echo ************************************** >> \\10.100.100.8\share\loginlog.txtWhich has worked fine for the XP boxes but it does not run on the new Windows 7 boxes.
Is it because I am calling my map drives from a separate script file. Here is what is in the VBS file...
Option Explicit On Error Resume Next ' Initializes Vars Dim objNetwork ' Creates Networking Object. Dim strStartingDrive ' Start all drives at this letter. Dim strRemotePath(10) ' Stores UNC paths. Dim strDriveLetter(10) ' Stores Drive Letters. Dim strUserName ' Stores the Users Login Name. Dim intNoDrives ' Number of Drives. Dim intLoop ' Loop Var. strStartingDrive = "" strRemotePath(10) = "" strDriveLetter(10) = "" strUserName = "" intNoDrives = 0 intLoop = 0 ' Constructs Object to get login info. set objNetwork = WScript.CreateObject("WScript.Network") strUserName = objNetwork.UserName ' Setsup Drive Arrays strStartingDrive = "H" intNoDrives = 2 '****** This must be the same as the number of paths you wish to map. ****** For intLoop = 0 to intNoDrives-1 strDriveLetter(intLoop) = chr(Asc(strStartingDrive) + intLoop) & ":" next ' Map the Drives strRemotePath(0) = "\\azdfbls.local\globalfiles\users\" & strUserName strRemotePath(1) = "\\azdfbls.local\globalfiles\share" ' Create Drive letters For intLoop = 0 to intNoDrives-1 objNetwork.MapNetworkDrive strDriveLetter(intLoop), strRemotePath(intLoop) next objNetwork.MapNetworkDrive "P:", "\\svr030\archives" objNetwork.MapNetworkDrive "M:", "\\svr030\OMH" objNetwork.MapNetworkDrive "Z:", "\\svr030\users" WScript.QuitAny help would be Appreciated.

Ok that worked.
According to the article it is a security risk. Is there a way to get the script to run at the right time so that you don't have to do it this way? I am not too worried about it since it is the same security risk I am running with the XP boxes.

Well, some people had limited success with setting a task to run in the context of the desired account when that account logs on. You could try the Startup menu.Or you could just tell them to run the script / map the drives themselves.
Really, the trick is to get the script to run in the correct (/ all) context(s).
Just remember, UAC was created to protect home users from themselves. It was not designed to protect business users with an IT staff backing them.
EDIT: I should note MS' workaround, which is the scheduled task approach.

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |