Cross Compatible (XP/Vista/7) Logon Script!

TechieSooner

Supreme [H]ardness
Joined
Nov 7, 2007
Messages
7,601
I *think* I've got my Launchapp.wsf working. Now my question is just creating a cross-compatible logon script that works on all the versions of Windows I have/will have.

Here's what I've got:
Code:
'MAP THE PRINTERS
Set objNetwork = CreateObject("WScript.Network") 
Dim objNetwork, strLocal, strUNCPrinter1, strUNCPrinter2
strUNCPrinter1 = "\\server\prt1"
strUNCPrinter2 = "\\server\prt2"
Set objNetwork = CreateObject("WScript.Network") 
objNetwork.AddWindowsPrinterConnection strUNCPrinter1
objNetwork.AddWindowsPrinterConnection strUNCPrinter2

'MAP THE DRIVES
Set objNetwork = CreateObject("WScript.Network") 
objNetwork.MapNetworkDrive "X:" , "\\server\Shared"

'Name the drives
Set objShell = CreateObject("Shell.Application")
objShell.NameSpace("X:").Self.Name = "Shared"
objShell.NameSpace("Z:").Self.Name = "Personal"


' Create a Desktop Shortcut for Shared Documents
Set WshShell = Wscript.CreateObject("Wscript.Shell")
Set oShellLink = WshShell.CreateShortcut(WshShell.SpecialFolders("Desktop") & "\Internal Website.url")
oShellLink.TargetPath = "X:\index.htm"
oShellLink.Save

Works fine on Windows XP, but fails on Vista.

I basically just want to A) Map Printers and B) Map Drives and C) Friendly Drive Names and D) Desktop Shortcut

Thanks!
 
Back
Top