DotNetNewbie
Programmer
Hi,
I have a script that runs when users login. Part of the script displays a greeting window, within this window it shows an image; which has been copied onto the users PC.
This works perfectly for XP, however Vista shows the greeting screen but not the image.
Any ideas:
'Script Syntax:
' GroupMember <GroupName> - returns a boolean value
' CreateSMFolder <FolderName>
' CreateSMIcon <Destination>, <Icon Name>, <Program Location>, <Working Directory>, <Arguments>, <IconLocation,IconNumber>, <WindowStyle 1=Normal 3=Max 7=Min>
' CreateDesktopIcon <Icon Name>, <Program Location>, <Working Directory>, <Arguments>, <IconLocation,IconNumber>, <WindowStyle 1=Normal 3=Max 7=Min>
'Option Explicit
'On Error Resume Next
Dim WSHENV, WSHShell, oFSO
Dim oShell, oNet, oWshNetwork, oGroupDict, oEnv, oShell2, oReg
Dim sUsername, sUserDomain, sLogonServer, sComputer, sSystemroot
Dim User
Dim lserver
Dim UserGroups(2000)
Dim GroupCount
Dim objGroup
Dim adsSystemInfo
Dim strBuildType
Dim filesys
Dim Username, usershare
DIM MSIE, sTitle
DIM Drive, Networkpath
DIM Maperror
Set oShell = CreateObject("Wscript.Shell")
Set oShell2 = Wscript.CreateObject("WSCript.shell")
Set oShell = Wscript.CreateObject("WSCript.shell")
Set oNet = CreateObject("Wscript.Network")
set oFSO = CreateObject("Scripting.FileSystemObject")
Set oEnv = oShell.Environment("Process")
set wshshell=createobject("wscript.shell")
set wshenv=wshshell.Environment("PROCESS")
sSystemroot = oEnv("Systemroot")
sComputer=oNet.ComputerName
sUsername = oEnv("Username")
envLogonServer = wshenv("LogonServer")
Set WshNetwork=wscript.CreateObject("Wscript.Network")
Set filesys = CreateObject("Scripting.FileSystemObject")
Set MSIE = CreateObject("InternetExplorer.Application")
Set adsSystemInfo = CreateObject("ADSystemInfo")
Set ObjUser = GetObject("LDAP://" & adsSysteminfo.username)
FullName = objUser.Get("name")
strBuildType = wshenv("BuildType")
' Display Welcome
DIM FileExist, Fso
Set Fso = CreateObject("Scripting.FileSystemObject")
FileExist = Fso.FileExists("C:\image.jpg")
If FileExist = False Then
Set fco=CreateObject("Scripting.FileSystemObject")
fco.CopyFile "\\server\share\image.jpg", "c:\",TRUE
End if
logo = "c:\image.jpg"
sTitle = "Processing Logon Script..."
Maperror = 0
SetupMSIE
MSIE.Document.Write "<HTML><TITLE>" & sTitle & "</TITLE><BODY bgcolor=#FFFFFF><FONT FACE=Verdana>"
MSIE.Document.Write "<p><img border=0 src=" & logo & " width=272 height=121></p><hr>"
If Hour(Now) < 12 Then
MSIE.Document.Write "<B>Good Morning " & Fullname & "</B><BR><BR>"
ElseIf Hour(Now) < 18 Then
MSIE.Document.Write "<B>Good Afternoon " & Fullname & "</B><BR><BR>"
Else
MSIE.Document.Write "<B>Good Evening " & Fullname & "</B><BR><BR>"
End If
MSIE.Document.Write "</FONT></BODY>"
Wscript.Sleep 3000
MSIE.Quit
Sub SetupMSIE
MSIE.Navigate "About:Blank"
MSIE.ToolBar = False
MSIE.StatusBar = False
MSIE.Resizable = False
Do
Loop While MSIE.Busy
SWidth = MSIE.Document.ParentWindow.Screen.AvailWidth
SHeight = MSIE.Document.ParentWindow.Screen.AvailHeight
MSIE.Width = Swidth/2
MSIE.Height = SHeight/2
MSIE.Left = (SWidth - MSIE.Width)/2
MSIE.Top = (Sheight - MSIE.Height)/2
MSIE.Visible = True
End Sub
I have a script that runs when users login. Part of the script displays a greeting window, within this window it shows an image; which has been copied onto the users PC.
This works perfectly for XP, however Vista shows the greeting screen but not the image.
Any ideas:
'Script Syntax:
' GroupMember <GroupName> - returns a boolean value
' CreateSMFolder <FolderName>
' CreateSMIcon <Destination>, <Icon Name>, <Program Location>, <Working Directory>, <Arguments>, <IconLocation,IconNumber>, <WindowStyle 1=Normal 3=Max 7=Min>
' CreateDesktopIcon <Icon Name>, <Program Location>, <Working Directory>, <Arguments>, <IconLocation,IconNumber>, <WindowStyle 1=Normal 3=Max 7=Min>
'Option Explicit
'On Error Resume Next
Dim WSHENV, WSHShell, oFSO
Dim oShell, oNet, oWshNetwork, oGroupDict, oEnv, oShell2, oReg
Dim sUsername, sUserDomain, sLogonServer, sComputer, sSystemroot
Dim User
Dim lserver
Dim UserGroups(2000)
Dim GroupCount
Dim objGroup
Dim adsSystemInfo
Dim strBuildType
Dim filesys
Dim Username, usershare
DIM MSIE, sTitle
DIM Drive, Networkpath
DIM Maperror
Set oShell = CreateObject("Wscript.Shell")
Set oShell2 = Wscript.CreateObject("WSCript.shell")
Set oShell = Wscript.CreateObject("WSCript.shell")
Set oNet = CreateObject("Wscript.Network")
set oFSO = CreateObject("Scripting.FileSystemObject")
Set oEnv = oShell.Environment("Process")
set wshshell=createobject("wscript.shell")
set wshenv=wshshell.Environment("PROCESS")
sSystemroot = oEnv("Systemroot")
sComputer=oNet.ComputerName
sUsername = oEnv("Username")
envLogonServer = wshenv("LogonServer")
Set WshNetwork=wscript.CreateObject("Wscript.Network")
Set filesys = CreateObject("Scripting.FileSystemObject")
Set MSIE = CreateObject("InternetExplorer.Application")
Set adsSystemInfo = CreateObject("ADSystemInfo")
Set ObjUser = GetObject("LDAP://" & adsSysteminfo.username)
FullName = objUser.Get("name")
strBuildType = wshenv("BuildType")
' Display Welcome
DIM FileExist, Fso
Set Fso = CreateObject("Scripting.FileSystemObject")
FileExist = Fso.FileExists("C:\image.jpg")
If FileExist = False Then
Set fco=CreateObject("Scripting.FileSystemObject")
fco.CopyFile "\\server\share\image.jpg", "c:\",TRUE
End if
logo = "c:\image.jpg"
sTitle = "Processing Logon Script..."
Maperror = 0
SetupMSIE
MSIE.Document.Write "<HTML><TITLE>" & sTitle & "</TITLE><BODY bgcolor=#FFFFFF><FONT FACE=Verdana>"
MSIE.Document.Write "<p><img border=0 src=" & logo & " width=272 height=121></p><hr>"
If Hour(Now) < 12 Then
MSIE.Document.Write "<B>Good Morning " & Fullname & "</B><BR><BR>"
ElseIf Hour(Now) < 18 Then
MSIE.Document.Write "<B>Good Afternoon " & Fullname & "</B><BR><BR>"
Else
MSIE.Document.Write "<B>Good Evening " & Fullname & "</B><BR><BR>"
End If
MSIE.Document.Write "</FONT></BODY>"
Wscript.Sleep 3000
MSIE.Quit
Sub SetupMSIE
MSIE.Navigate "About:Blank"
MSIE.ToolBar = False
MSIE.StatusBar = False
MSIE.Resizable = False
Do
Loop While MSIE.Busy
SWidth = MSIE.Document.ParentWindow.Screen.AvailWidth
SHeight = MSIE.Document.ParentWindow.Screen.AvailHeight
MSIE.Width = Swidth/2
MSIE.Height = SHeight/2
MSIE.Left = (SWidth - MSIE.Width)/2
MSIE.Top = (Sheight - MSIE.Height)/2
MSIE.Visible = True
End Sub