Need some help with VB logon script mapping network drives with Vista. Did some research on the problem, tried the launchapp.wsf in the GPO, this did not work. I'm thinking that something is wrong with my VB script. The script works fine on a Windows XP machine and it also runs fine just running the script from the desktop, but just on running it from GPO logon. The code is below.
'Logon Script for Group Policy
'Functions - Map Drives, add and remove icons to desktop
'Running Track-it inventory on machines on start up
'Start of Script
'On Error Resume Next
'Setting Variables
Dim objNetwork
Dim objShell
Dim strDesktop
Dim objShortcut
Dim objURL
Dim oShell
Dim audit
Set objNetwork = CreateObject("WScript.netw
ork")
Set objShell = WScript.CreateObject("WScr
ipt.Shell"
)
Set oShell = CreateObject("WScript.Shel
l")
'Getting Time for display message
sTime = Time
'Getting User Information to display in message
strUser = objNetwork.UserName
strHost = objNetwork.ComputerName
'Mapping Drives
objNetwork.MapNetworkDrive
"F:", "\\Server1\SYS"
objNetwork.MapNetworkDrive
"K:", "\\server2\DCSI"
objNetwork.MapNetworkDrive
"p:", "\\server3\Applications"
objNetwork.MapNetworkDrive
"T:", "\\server4\Quadrant"
'objNetwork.MapNetworkDriv
e "V:", "\\server5\SYS\Users\" & strUser & ""
'Create Shortcuts
strDesktop = objShell.SpecialFolders("D
esktop")
'-------------------------
----------
-----Plant
Wide Documents-----------------
--------
Set objShortcut = objShell.CreateShortcut(st
rDesktop & "\PlantwideDocuments.lnk")
With objShortcut
.TargetPath = objShell.ExpandEnvironment
Strings("F
:\ISO\OVER
VIEW\Syste
m.igx")
.WorkingDirectory = objShell.ExpandEnvironment
Strings("F
:\ISO\OVER
VIEW")
.WindowStyle = 1
.IconLocation = objShell.ExpandEnvironment
Strings("c
:\Program Files\iGrafx\pro\12.0\Flow
.exe, 0")
.Save
End With
'-------------------------
----------
-----Key Measures------------------
----------
----
Set objShortcut = objShell.CreateShortcut(st
rDesktop & "\keymeasures.lnk")
With objShortcut
.TargetPath = objShell.ExpandEnvironment
Strings("F
:\GROUP\ST
RGPLAN\KEY
MEAS\keyme
as.igx")
.WorkingDirectory = objShell.ExpandEnvironment
Strings("F
:\GROUP\ST
RGPLAN\KEY
MEAS")
.WindowStyle = 1
.IconLocation = objShell.ExpandEnvironment
Strings("c
:\Program Files\iGrafx\pro\12.0\Flow
.exe, 0")
.Save
End With
'-------------------------
----------
------Scar
Database------------------
----------
--
Set objShortcut = objShell.CreateShortcut(st
rDesktop & "\Scar.mdb.lnk")
With objShortcut
.TargetPath = objShell.ExpandEnvironment
Strings("F
:\Group\MS
G\C-a_Data
\Scar.mdb"
)
.WorkingDirectory = objShell.ExpandEnvironment
Strings("F
:\F:\Group
\MSG\C-a_D
ata\")
.WindowStyle = 1
'.IconLocation = objShell.ExpandEnvironment
Strings("c
:\Program Files\Microsoft Office\Office\MSACCESS.exe
, 0")
.IconLocation = objShell.ExpandEnvironment
Strings("c
:\Program Files\Microsoft Office\Office12\MSACCESS.e
xe, 0")
.Save
End With
'-------------------------
----------
------Corr
ective Actions-------------------
------
Set objShortcut = objShell.CreateShortcut(st
rDesktop & "\CorrectiveAction.mdb.lnk
")
With objShortcut
.TargetPath = objShell.ExpandEnvironment
Strings("F
:\Group\MS
G\C-a_Data
\Correctiv
eAction.md
b")
.WorkingDirectory = objShell.ExpandEnvironment
Strings("F
:\F:\Group
\MSG\C-a_D
ata\")
.WindowStyle = 1
'.IconLocation = objShell.ExpandEnvironment
Strings("c
:\Program Files\Microsoft Office\Office\MSACCESS.exe
, 0")
.IconLocation = objShell.ExpandEnvironment
Strings("c
:\Program Files\Microsoft Office\Office12\MSACCESS.e
xe, 0")
.Save
End With
'-------------------------
----------
------Main
tenance Requests------------------
------
Set objShortcut = objShell.CreateShortcut(st
rDesktop & "\Maintenance Requests.mdb.lnk")
With objShortcut
.TargetPath = objShell.ExpandEnvironment
Strings("F
:\GROUP\Ma
intenance\
Public\Mai
ntprojects
.mdb")
.WorkingDirectory = objShell.ExpandEnvironment
Strings("F
:\F:\Group
\MSG\C-a_D
ata\")
.WindowStyle = 1
'.IconLocation = objShell.ExpandEnvironment
Strings("c
:\Program Files\Microsoft Office\Office\MSACCESS.exe
, 0")
.IconLocation = objShell.ExpandEnvironment
Strings("c
:\Program Files\Microsoft Office\Office12\MSACCESS.e
xe, 0")
.Save
End With
''''''''''''''''''''''''''
''''''''WI
NS
Set objURL = objShell.CreateShortcut(st
rDesktop & "\WINS.url")
objURL.TargetPath = "
http://www.wins-inc.com/company/"
objURL.Save
'Call Audit32.exe
Set oShell = CreateObject("WScript.Shel
l")
audit = "\\aecapp\trackit80\audit3
2.exe"
Call oShell.Run(audit,0,True)
'Display Message
MsgBox "Welcome to Company " & strUser & ", The Time is " & sTime & " You are now logged onto " & strHost & "."
Start Free Trial