Computing.Net > Forums > Windows Server 2003 > Login Script not working on Windows 7

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Login Script not working on Windows 7

Reply to Message Icon

Name: ace_omega
Date: October 22, 2009 at 10:33:42 Pacific
OS: Windows 7
CPU/Ram: Quad Core / 4Gig
Product: Hp (hewlett-packard) Ms windows server 2003 r2 ent option kit hewlett packard
Subcategory: General
Comment:

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.txt

Which 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.Quit

Any help would be Appreciated.



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: October 22, 2009 at 12:23:49 Pacific
Reply:
0

Response Number 2
Name: ace_omega
Date: October 22, 2009 at 13:25:56 Pacific
Reply:

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.


0

Response Number 3
Name: Razor2.3
Date: October 22, 2009 at 14:37:48 Pacific
Reply:

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.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Login Script not working on Windows 7

GPO not working on workstations www.computing.net/answers/windows-2003/gpo-not-working-on-workstations/8606.html

Working on Windows server 2003 www.computing.net/answers/windows-2003/working-on-windows-server-2003/7022.html

USB IDE xternal hardisk not working www.computing.net/answers/windows-2003/usb-ide-xternal-hardisk-not-working/1437.html