Solved

VB help

Posted on 2008-10-09
15
328 Views
Last Modified: 2012-08-13
Hi! there,

I would like incorporate this vb script into a larger script my company is using that is applied when the users login. Can you explain where in the script I can insert this one at. I tested this script on its own and it is working fine. when i add this script to the logon script are there any changes I have to do this one. Sorry for my lack of knowledge on scripting but I really need some advice before I add this one.
-------------------------------------------------------------------------------------------------------
' Create Objects
Set objNetwork = Wscript.CreateObject("Wscript.Network")
Set objFSO = CreateObject("Scripting.FileSystemObject")
set WshShell = WScript.CreateObject("WScript.Shell")
 
' Set Variables
strDesktop = WshShell.SpecialFolders("Desktop")
 
 
' Process
strTest = Mid(objNetwork.ComputerName, 1, 3)
If UCase(strTest) = "M00" Then
    If objFSO.FileExists(strDesktop & "\Guide.lnk") Then
        set oUrlLink = WshShell.CreateShortcut(strDesktop & "\Guide.lnk")
        oUrlLink.TargetPath = "C:\apps\guide.pdf"
        oUrlLink.Save
    End If
Elseif UCase(strTest = "M01" Then
    If objFSO.FileExists(strDesktop & "\Guide.lnk") Then
        set oUrlLink = WshShell.CreateShortcut(strDesktop & "\Guide.lnk")
        oUrlLink.TargetPath = "C:\apps\guide.pdf"
        oUrlLink.Save
    End If
Else
    'Do Nothing
End If

----------------------------------------------------------------------------------------------------------------
0
Comment
Question by:Zak
  • 8
  • 6
15 Comments
 
LVL 65

Expert Comment

by:RobSampson
ID: 22684307
Hi, if your main script already has these objects:
Set objNetwork = Wscript.CreateObject("Wscript.Network")
Set objFSO = CreateObject("Scripting.FileSystemObject")
set WshShell = WScript.CreateObject("WScript.Shell")

then you don't need those lines.  But they don't hurt anyway.

So, essentially, this code should survive anywhere in your script.  What you can also do, is have all of that code inside a Sub procedure, then just call that from your main code whenever you want it to run.

Also, I've noticed that in both of your If conditions, you perform exactly the same actions, so you can shorten that a bit.....

In the code below, the
Call Change_Desktop_Links

line can be placed anywhere in the main code, with the Sub procedure being placed at the end of the main code.

Regards,

Rob.
Call Change_Desktop_Links
 

Sub Change_Desktop_Links()

	' Create Objects

	Set objNetwork = Wscript.CreateObject("Wscript.Network")

	Set objFSO = CreateObject("Scripting.FileSystemObject")

	Set WshShell = WScript.CreateObject("WScript.Shell")
 

	' Set Variables

	strDesktop = WshShell.SpecialFolders("Desktop")
 

	' Process

	strTest = Mid(objNetwork.ComputerName, 1, 3)

	If UCase(strTest) = "M00" Or UCase(strTest) = "M01" Then

	    If objFSO.FileExists(strDesktop & "\Guide.lnk") Then

	        set oUrlLink = WshShell.CreateShortcut(strDesktop & "\Guide.lnk")

	        oUrlLink.TargetPath = "C:\apps\guide.pdf"

	        oUrlLink.Save

	    End If

	Else

	    'Do Nothing

	End If

End Sub

Open in new window

0
 
LVL 21

Expert Comment

by:AmazingTech
ID: 22684323
Without seeing the other script it is difficult to determine.

You should be able to put it almost anywhere. Just make sure it does get processed under all conditions. Meaning if your bigger script does a check and utilizes wscript.quit to exit then it may not get to this script.

The safest I would say is to put it at the end.  This way you don't break your existing login script.

Be sure to set your objects to nothing so you don't get a create error trying to create the other object with the same name.

If your existing script is so big that you cannot determine whether you have existing objects already created you could also set the object you will be using to nothing before your attached script runs.

Set objNetwork = Nothing
Set objFSO = Nothing
set WshShell = Nothing
set oUrlLink = Nothing


' Create Objects

Set objNetwork = Wscript.CreateObject("Wscript.Network")

Set objFSO = CreateObject("Scripting.FileSystemObject")

set WshShell = WScript.CreateObject("WScript.Shell")

 

' Set Variables

strDesktop = WshShell.SpecialFolders("Desktop")

 

 

' Process

strTest = Mid(objNetwork.ComputerName, 1, 3)

If UCase(strTest) = "M00" Then

    If objFSO.FileExists(strDesktop & "\Guide.lnk") Then

        set oUrlLink = WshShell.CreateShortcut(strDesktop & "\Guide.lnk")

        oUrlLink.TargetPath = "C:\apps\guide.pdf"

        oUrlLink.Save

    End If

Elseif UCase(strTest = "M01" Then

    If objFSO.FileExists(strDesktop & "\Guide.lnk") Then

        set oUrlLink = WshShell.CreateShortcut(strDesktop & "\Guide.lnk")

        oUrlLink.TargetPath = "C:\apps\guide.pdf"

        oUrlLink.Save

    End If

Else

    'Do Nothing

End If
 

Set objNetwork = Nothing

Set objFSO = Nothing

set WshShell = Nothing

set oUrlLink = Nothing

Open in new window

0
 

Author Comment

by:Zak
ID: 22695938
Thank you for your reply. I am attaching the test script that I to add that short script to. Also It is possible to have this script modified to add the guide,pdf or link under IE favorits and also to the desktop. If it is possible. Thanks,
First lets not do any change to the small script and then lets do the change on the script to also add a link under the IE --> Favorites

Test.txt
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 22699496
Hi, this is your test script, plus the small script, added together, without the addition of the IE Favorites link.

Just a small note, it can be bad practice to use
Option Explicit
and
On Error Resume Next

because if a variable used somewhere in the code is not defined, you won't know about.  I usually leave
On Error Resume Next
out of my scripts, unless it has been completely tested without it, and I add it "just in case".

Regards,

Rob.
'==========================================================

'==========================================================

' default logon script 

'==========================================================

Option Explicit		' This ensures that ALL variables have to be declared, this prevents random variables being used.

On Error Resume Next  

Const cDebug = False

If cDebug Then On Error Goto 0	' tells scripting engine to complete the script without prompting the user even when it finds an error!

Dim Title, Version, DlgTitle

Title = "x Logon Script"

Version = "v2.1b"	' (08/09/2008)

DlgTitle = Title & " " & Version
 

'==========================================================

'==========================================================

' INITIALISATION - set standard variables

'==========================================================

' establish path to current Netlogon folder

Dim NetLogon,LogonServer,ServerString

Dim RegX

Set RegX = New RegExp

Dim SearchPattern, ReplacedText,ReplaceString

' establish path to current Netlogon folder

NetLogon = LCase(Mid(Wscript.ScriptFullName, 1, InStrRev(Wscript.ScriptFullName,"\")))
 

'Include standard files:

Dim oTmp : Set oTmp = WScript.CreateObject("Scripting.FileSystemObject")
 

'Set WSiexplore = CreateObject("InternetExplorer.Application")

'Set objEnv = WSshell.Environment("System")

Dim aFileName,aFile

aFileName = NetLogon & "includes\default.vbs"

If oTmp.FileExists(aFileName) Then

	Set aFile = oTmp.OpenTextFile(aFileName)

	ExecuteGlobal aFile.ReadAll

	aFile.Close

Else

	MsgBox "ERROR: library file not found - " & aFileName & ". Please report this error to Service Desk."

 	Wscript.quit

End If

'==========================================================

'==========================================================

' MAIN - run by all users on all sites on all clients

'==========================================================

	' Create logon box

	Dim GreetingTime

	GreetingTime = "evening"

	If Hour(Now) <= 18 Then GreetingTime = "afternoon"

	If Hour(Now) <= 11 Then GreetingTime = "morning"

	Select Case fnRegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Apps\LogonScript\View")

		Case "Min"

			Call fnCreateMonitorMin(DlgTitle)

		Case Else

			Call fnCreateMonitor(DlgTitle)

	End Select

	fnUpdateAction "Running script " & ScriptFullName

	fnLogLine "  " & Date & " - " & Time

	fnAddLine "Good " & GreetingTime & " " & UCase(UserName)

	fnLogLine "  Machine Name: " & UCase(MachineName) & " (" & OSVersion & " " & SPNumber & ")"

	If Site <> "" Then fnAddLine "Welcome to " & Site

'==========================================================

' GLOBAL SCRIPTS - run by all users on all sites on all clients

'==========================================================

'==========================================================

	fnUpdateDetail "Creating groups list..."

	oShell.run "wscript.exe //b /nologo " & Netlogon & "general\groups.vbs", 0, False

	PctDone = PctDone + PctStep : fnUpdateProgressBar PctDone  ' advance progbar

'==========================================================

	' run groups based processing...

	fnIncludeScript Netlogon & "general\groups.vbs"

	PctDone = PctDone + PctStep : fnUpdateProgressBar PctDone  ' advance progbar

'==========================================================

	fnUpdateDetail "Create Locator shortcut..."

	Set oShortcut = oShell.CreateShortcut(DesktopFolder & "\finder.url")

	oShortcut.TargetPath = "http://Getranet/finder/"

	oShortcut.Save

'==========================================================

	'	Load Geranet frontpage...

	Dim oIE,lCount			                   'Internet Explorer object and Loop count

	lcount = 0

        Set oIE = WScript.CreateObject("InternetExplorer.Application")

	If not DenyHalnet Then

		If TestHalnetLaunch2 then

                    oIE.navigate "http://Geranet"	   'window is hidden

	            Do While (oIE.Busy) and lcount	< 600

			lcount = lcount + 1

                        WScript.Sleep 200	           'wait 200 milliseconds

                    Loop

                    If oIE.Busy then

                        oIE.Stop

                    else

                        oIE.Quit			   'close hidden IE window

                    End If

                    fnUpdateDetail "Loading Geranet..."

		    WScript.Sleep 2000                     'wait 2 secs

                    Set oIE = WScript.CreateObject("InternetExplorer.Application")

                    lcount = 0

                    oIE.Navigate "http://Geranet"

		    Do While oIE.Busy and lcount < 600

			lcount = lcount + 1

                        WScript.Sleep 200	           'wait 200 milliseconds

		    Loop

		    If oIE.Busy then

                        oIE.Stop

                    else

                        oIE.Visible = True                 'Display Halnet page

                    End If

		else 'launch Halnet using original method

                    fnUpdateDetail "Loading Geranet..."

                    oShell.run "http://Geranet", 4, False

                End If

	End If

	Set oIE = Nothing

	PctDone = PctDone + PctStep : fnUpdateProgressBar PctDone  ' advance progbar
 

'==========================================================

' Run the new section to update desktop shortcuts

Call Change_Desktop_Links
 

'==========================================================

'==========================================================

' FINISH SCRIPT

'==========================================================

	fnUpdateDetail ""

	fnUpdateProgressBar 100  ' advance progbar

	fnAddLine ""

	fnAddLine "Logon complete...closing now..."

	fnLogLine Date & " @ " & Time

	Wscript.Quit(0)

	

'==========================================================

'==========================================================

' PROCEDURE TO CHANGE DESKTOP SHORTCUTS

Sub Change_Desktop_Links()

	' Create Objects

	Dim objNetwork, objFSO, WshShell, strDesktop, strTest, oUrlLink

	Set objNetwork = Wscript.CreateObject("Wscript.Network")

	Set objFSO = CreateObject("Scripting.FileSystemObject")

	Set WshShell = WScript.CreateObject("WScript.Shell")

 

	' Set Variables

	strDesktop = WshShell.SpecialFolders("Desktop")

 

	' Process

	strTest = Mid(objNetwork.ComputerName, 1, 3)

	If UCase(strTest) = "M00" Or UCase(strTest) = "M01" Then

	    If objFSO.FileExists(strDesktop & "\Guide.lnk") Then

	        set oUrlLink = WshShell.CreateShortcut(strDesktop & "\Guide.lnk")

	        oUrlLink.TargetPath = "C:\apps\guide.pdf"

	        oUrlLink.Save

	    End If

	Else

	    'Do Nothing

	End If

End Sub

'==========================================================

Open in new window

0
 
LVL 65

Expert Comment

by:RobSampson
ID: 22699558
And if all that goes well, here's another addition to add URLs to favorites.

You'll see this line:
Add_URL_To_Favorites "http://www.experts-exchange.com"

where you can copy that line and add more URLs.

Regards,

Rob.
'==========================================================

'==========================================================

' default logon script 

'==========================================================

Option Explicit		' This ensures that ALL variables have to be declared, this prevents random variables being used.

On Error Resume Next  

Const cDebug = False

If cDebug Then On Error Goto 0	' tells scripting engine to complete the script without prompting the user even when it finds an error!

Dim Title, Version, DlgTitle

Title = "x Logon Script"

Version = "v2.1b"	' (08/09/2008)

DlgTitle = Title & " " & Version

 

'==========================================================

'==========================================================

' INITIALISATION - set standard variables

'==========================================================

' establish path to current Netlogon folder

Dim NetLogon,LogonServer,ServerString

Dim RegX

Set RegX = New RegExp

Dim SearchPattern, ReplacedText,ReplaceString

' establish path to current Netlogon folder

NetLogon = LCase(Mid(Wscript.ScriptFullName, 1, InStrRev(Wscript.ScriptFullName,"\")))

 

'Include standard files:

Dim oTmp : Set oTmp = WScript.CreateObject("Scripting.FileSystemObject")

 

'Set WSiexplore = CreateObject("InternetExplorer.Application")

'Set objEnv = WSshell.Environment("System")

Dim aFileName,aFile

aFileName = NetLogon & "includes\default.vbs"

If oTmp.FileExists(aFileName) Then

	Set aFile = oTmp.OpenTextFile(aFileName)

	ExecuteGlobal aFile.ReadAll

	aFile.Close

Else

	MsgBox "ERROR: library file not found - " & aFileName & ". Please report this error to Service Desk."

 	Wscript.quit

End If

'==========================================================

'==========================================================

' MAIN - run by all users on all sites on all clients

'==========================================================

	' Create logon box

	Dim GreetingTime

	GreetingTime = "evening"

	If Hour(Now) <= 18 Then GreetingTime = "afternoon"

	If Hour(Now) <= 11 Then GreetingTime = "morning"

	Select Case fnRegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Apps\LogonScript\View")

		Case "Min"

			Call fnCreateMonitorMin(DlgTitle)

		Case Else

			Call fnCreateMonitor(DlgTitle)

	End Select

	fnUpdateAction "Running script " & ScriptFullName

	fnLogLine "  " & Date & " - " & Time

	fnAddLine "Good " & GreetingTime & " " & UCase(UserName)

	fnLogLine "  Machine Name: " & UCase(MachineName) & " (" & OSVersion & " " & SPNumber & ")"

	If Site <> "" Then fnAddLine "Welcome to " & Site

'==========================================================

' GLOBAL SCRIPTS - run by all users on all sites on all clients

'==========================================================

'==========================================================

	fnUpdateDetail "Creating groups list..."

	oShell.run "wscript.exe //b /nologo " & Netlogon & "general\groups.vbs", 0, False

	PctDone = PctDone + PctStep : fnUpdateProgressBar PctDone  ' advance progbar

'==========================================================

	' run groups based processing...

	fnIncludeScript Netlogon & "general\groups.vbs"

	PctDone = PctDone + PctStep : fnUpdateProgressBar PctDone  ' advance progbar

'==========================================================

	fnUpdateDetail "Create Locator shortcut..."

	Set oShortcut = oShell.CreateShortcut(DesktopFolder & "\finder.url")

	oShortcut.TargetPath = "http://Getranet/finder/"

	oShortcut.Save

'==========================================================

	'	Load Geranet frontpage...

	Dim oIE,lCount			                   'Internet Explorer object and Loop count

	lcount = 0

        Set oIE = WScript.CreateObject("InternetExplorer.Application")

	If not DenyHalnet Then

		If TestHalnetLaunch2 then

                    oIE.navigate "http://Geranet"	   'window is hidden

	            Do While (oIE.Busy) and lcount	< 600

			lcount = lcount + 1

                        WScript.Sleep 200	           'wait 200 milliseconds

                    Loop

                    If oIE.Busy then

                        oIE.Stop

                    else

                        oIE.Quit			   'close hidden IE window

                    End If

                    fnUpdateDetail "Loading Geranet..."

		    WScript.Sleep 2000                     'wait 2 secs

                    Set oIE = WScript.CreateObject("InternetExplorer.Application")

                    lcount = 0

                    oIE.Navigate "http://Geranet"

		    Do While oIE.Busy and lcount < 600

			lcount = lcount + 1

                        WScript.Sleep 200	           'wait 200 milliseconds

		    Loop

		    If oIE.Busy then

                        oIE.Stop

                    else

                        oIE.Visible = True                 'Display Halnet page

                    End If

		else 'launch Halnet using original method

                    fnUpdateDetail "Loading Geranet..."

                    oShell.run "http://Geranet", 4, False

                End If

	End If

	Set oIE = Nothing

	PctDone = PctDone + PctStep : fnUpdateProgressBar PctDone  ' advance progbar

 

'==========================================================

' Run the new section to update desktop shortcuts

Change_Desktop_Links
 

'==========================================================

' Run the new section to add URLs to Favorites

Add_URL_To_Favorites "http://www.experts-exchange.com"
 

'==========================================================

'==========================================================

' FINISH SCRIPT

'==========================================================

	fnUpdateDetail ""

	fnUpdateProgressBar 100  ' advance progbar

	fnAddLine ""

	fnAddLine "Logon complete...closing now..."

	fnLogLine Date & " @ " & Time

	Wscript.Quit(0)

	

'==========================================================

'==========================================================

' PROCEDURE TO CHANGE DESKTOP SHORTCUTS

Sub Change_Desktop_Links()

	' Create Objects

	Dim objNetwork, objFSO, WshShell, strDesktop, strTest, oUrlLink

	Set objNetwork = Wscript.CreateObject("Wscript.Network")

	Set objFSO = CreateObject("Scripting.FileSystemObject")

	Set WshShell = WScript.CreateObject("WScript.Shell")

 

	' Set Variables

	strDesktop = WshShell.SpecialFolders("Desktop")

 

	' Process

	strTest = Mid(objNetwork.ComputerName, 1, 3)

	If UCase(strTest) = "M00" Or UCase(strTest) = "M01" Then

	    If objFSO.FileExists(strDesktop & "\Guide.lnk") Then

	        set oUrlLink = WshShell.CreateShortcut(strDesktop & "\Guide.lnk")

	        oUrlLink.TargetPath = "C:\apps\guide.pdf"

	        oUrlLink.Save

	    End If

	Else

	    'Do Nothing

	End If

End Sub

'==========================================================
 

'==========================================================

'==========================================================

' PROCEDURE TO ADD IE FAVORITE

Sub Add_URL_To_Favorites(strURL)

	Dim objFSO, objShell, strFavorites, objShortcut, strFavLink, strTitle

	Set objFSO = CreateObject("Scripting.FileSystemObject")

	Set objShell = CreateObject("WScript.Shell")

	strFavorites = objShell.ExpandEnvironmentStrings("%USERPROFILE%") & "\Favorites\"

	strFavLink = Replace(strURL, """", "")

	strTitle = Replace(LCase(strFavLink), "http://", "")

	If Right(strTitle, 1) = "/" Then strTitle = Left(strTitle, Len(strTitle) - 1)

	strTitle= Replace(strTitle, "/", "_") & ".url"

	MsgBox "Adding " & strFavLink & " as " & strTitle

	' Create and save the shortcut file

	Set objShortcut = objShell.CreateShortcut(strFavorites & strTitle)

	objShortcut.TargetPath = strURL

	objShortcut.Save

	Set objShortcut = Nothing

End Sub

'==========================================================

Open in new window

0
 

Author Comment

by:Zak
ID: 22699899
This login scripts runs every time a user logins to the network. With regard to shortcut to favorites will this be ok. Or do we need the script modified to check if the shortcut is already in the IE--> Favorits first and if not it will be added.
What do u think ?
0
 

Author Comment

by:Zak
ID: 22699906
Also the shortcut in the IE--> Favorits is the pdf file copied to C:\Apps\guide.pdf
Thanks
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 65

Expert Comment

by:RobSampson
ID: 22707523
>> This login scripts runs every time a user logins to the network. With regard to shortcut to favorites will this be ok.

Yes, it would just replace the existing favorite, and revert it back if the user happened to change it's targetpath too.

I have changed the
Sub Add_URL_To_Favorites(strURL)

to create a target path to a file, as well as a URL, if required.

Regards,

Rob.
Add_URL_To_Favorites "C:\Temp\48.pdf"
 

Sub Add_URL_To_Favorites(strURL)

	Dim objFSO, objShell, strFavorites, objShortcut, strFavLink, strTitle

	Set objFSO = CreateObject("Scripting.FileSystemObject")

	Set objShell = CreateObject("WScript.Shell")

	strFavorites = objShell.ExpandEnvironmentStrings("%USERPROFILE%") & "\Favorites\"

	strFavLink = Replace(strURL, """", "")

	' Use two checks to see if the target path is a file, not a web link

	If Mid(strFavLink, 2, 1) = ":" Or InStr(strFavLink, "\") > 0 Then

		strTitle = Replace(LCase(strFavLink), "file://", "")

		If Right(strTitle, 1) = "\" Then strTitle = Left(strTitle, Len(strTitle) - 1)

		strTitle = Replace(Replace(strTitle, "\", "_"), ":", "-") & ".lnk"

	Else

		strTitle = Replace(LCase(strFavLink), "http://", "")

		If Right(strTitle, 1) = "/" Then strTitle = Left(strTitle, Len(strTitle) - 1)

		strTitle = Replace(Replace(strTitle, "/", "_"), ":", "-") & ".url"

	End If

	' MsgBox "Adding " & strFavLink & " as " & strTitle

	' Create and save the shortcut file

	Set objShortcut = objShell.CreateShortcut(strFavorites & strTitle)

	objShortcut.TargetPath = strURL

	objShortcut.Save

	Set objShortcut = Nothing

End Sub

Open in new window

0
 

Author Comment

by:Zak
ID: 22707901
Thanks for your help on this one. I appreciated.
There is a slight change on the desktop shortcut requirement. Can you modify it so that the script check first if the Guide.PDF is in the C:\TEMP\Guide.pdf  and if yes then it shoud proceed to make the shortcut on the desktop other wise if should not create the shortcut on the desktop.
Thanks
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 22707939
No problem.  I've now added this bit:

' Run the new section to add URLs to Favorites
Set objFSO = CreateObject("Scripting.FileSystemObject")
strGuide = "C:\Temp\GUIDE.pdf"
If objFSO.FileExists(strGuide) = True Then Add_URL_To_Favorites strGuide

Regards,

Rob.
'==========================================================

'==========================================================

' default logon script 

'==========================================================

Option Explicit		' This ensures that ALL variables have to be declared, this prevents random variables being used.

On Error Resume Next  

Const cDebug = False

If cDebug Then On Error Goto 0	' tells scripting engine to complete the script without prompting the user even when it finds an error!

Dim Title, Version, DlgTitle

Title = "x Logon Script"

Version = "v2.1b"	' (08/09/2008)

DlgTitle = Title & " " & Version

 

'==========================================================

'==========================================================

' INITIALISATION - set standard variables

'==========================================================

' establish path to current Netlogon folder

Dim NetLogon,LogonServer,ServerString

Dim RegX

Set RegX = New RegExp

Dim SearchPattern, ReplacedText,ReplaceString

' establish path to current Netlogon folder

NetLogon = LCase(Mid(Wscript.ScriptFullName, 1, InStrRev(Wscript.ScriptFullName,"\")))

 

'Include standard files:

Dim oTmp : Set oTmp = WScript.CreateObject("Scripting.FileSystemObject")

 

'Set WSiexplore = CreateObject("InternetExplorer.Application")

'Set objEnv = WSshell.Environment("System")

Dim aFileName,aFile

aFileName = NetLogon & "includes\default.vbs"

If oTmp.FileExists(aFileName) Then

	Set aFile = oTmp.OpenTextFile(aFileName)

	ExecuteGlobal aFile.ReadAll

	aFile.Close

Else

	MsgBox "ERROR: library file not found - " & aFileName & ". Please report this error to Service Desk."

 	Wscript.quit

End If

'==========================================================

'==========================================================

' MAIN - run by all users on all sites on all clients

'==========================================================

	' Create logon box

	Dim GreetingTime

	GreetingTime = "evening"

	If Hour(Now) <= 18 Then GreetingTime = "afternoon"

	If Hour(Now) <= 11 Then GreetingTime = "morning"

	Select Case fnRegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Apps\LogonScript\View")

		Case "Min"

			Call fnCreateMonitorMin(DlgTitle)

		Case Else

			Call fnCreateMonitor(DlgTitle)

	End Select

	fnUpdateAction "Running script " & ScriptFullName

	fnLogLine "  " & Date & " - " & Time

	fnAddLine "Good " & GreetingTime & " " & UCase(UserName)

	fnLogLine "  Machine Name: " & UCase(MachineName) & " (" & OSVersion & " " & SPNumber & ")"

	If Site <> "" Then fnAddLine "Welcome to " & Site

'==========================================================

' GLOBAL SCRIPTS - run by all users on all sites on all clients

'==========================================================

'==========================================================

	fnUpdateDetail "Creating groups list..."

	oShell.run "wscript.exe //b /nologo " & Netlogon & "general\groups.vbs", 0, False

	PctDone = PctDone + PctStep : fnUpdateProgressBar PctDone  ' advance progbar

'==========================================================

	' run groups based processing...

	fnIncludeScript Netlogon & "general\groups.vbs"

	PctDone = PctDone + PctStep : fnUpdateProgressBar PctDone  ' advance progbar

'==========================================================

	fnUpdateDetail "Create Locator shortcut..."

	Set oShortcut = oShell.CreateShortcut(DesktopFolder & "\finder.url")

	oShortcut.TargetPath = "http://Getranet/finder/"

	oShortcut.Save

'==========================================================

	'	Load Geranet frontpage...

	Dim oIE,lCount			                   'Internet Explorer object and Loop count

	lcount = 0

        Set oIE = WScript.CreateObject("InternetExplorer.Application")

	If not DenyHalnet Then

		If TestHalnetLaunch2 then

                    oIE.navigate "http://Geranet"	   'window is hidden

	            Do While (oIE.Busy) and lcount	< 600

			lcount = lcount + 1

                        WScript.Sleep 200	           'wait 200 milliseconds

                    Loop

                    If oIE.Busy then

                        oIE.Stop

                    else

                        oIE.Quit			   'close hidden IE window

                    End If

                    fnUpdateDetail "Loading Geranet..."

		    WScript.Sleep 2000                     'wait 2 secs

                    Set oIE = WScript.CreateObject("InternetExplorer.Application")

                    lcount = 0

                    oIE.Navigate "http://Geranet"

		    Do While oIE.Busy and lcount < 600

			lcount = lcount + 1

                        WScript.Sleep 200	           'wait 200 milliseconds

		    Loop

		    If oIE.Busy then

                        oIE.Stop

                    else

                        oIE.Visible = True                 'Display Halnet page

                    End If

		else 'launch Halnet using original method

                    fnUpdateDetail "Loading Geranet..."

                    oShell.run "http://Geranet", 4, False

                End If

	End If

	Set oIE = Nothing

	PctDone = PctDone + PctStep : fnUpdateProgressBar PctDone  ' advance progbar

 

'==========================================================

' Run the new section to update desktop shortcuts

Change_Desktop_Links

 

'==========================================================

' Run the new section to add URLs to Favorites

Set objFSO = CreateObject("Scripting.FileSystemObject")

strGuide = "C:\Temp\GUIDE.pdf"

If objFSO.FileExists(strGuide) = True Then Add_URL_To_Favorites strGuide

 

'==========================================================

'==========================================================

' FINISH SCRIPT

'==========================================================

	fnUpdateDetail ""

	fnUpdateProgressBar 100  ' advance progbar

	fnAddLine ""

	fnAddLine "Logon complete...closing now..."

	fnLogLine Date & " @ " & Time

	Wscript.Quit(0)

	

'==========================================================

'==========================================================

' PROCEDURE TO CHANGE DESKTOP SHORTCUTS

Sub Change_Desktop_Links()

	' Create Objects

	Dim objNetwork, objFSO, WshShell, strDesktop, strTest, oUrlLink

	Set objNetwork = Wscript.CreateObject("Wscript.Network")

	Set objFSO = CreateObject("Scripting.FileSystemObject")

	Set WshShell = WScript.CreateObject("WScript.Shell")

 

	' Set Variables

	strDesktop = WshShell.SpecialFolders("Desktop")

 

	' Process

	strTest = Mid(objNetwork.ComputerName, 1, 3)

	If UCase(strTest) = "M00" Or UCase(strTest) = "M01" Then

	    If objFSO.FileExists(strDesktop & "\Guide.lnk") Then

	        set oUrlLink = WshShell.CreateShortcut(strDesktop & "\Guide.lnk")

	        oUrlLink.TargetPath = "C:\apps\guide.pdf"

	        oUrlLink.Save

	    End If

	Else

	    'Do Nothing

	End If

End Sub

'==========================================================

 

'==========================================================

'==========================================================

' PROCEDURE TO ADD IE FAVORITE

Sub Add_URL_To_Favorites(strURL)

	Dim objFSO, objShell, strFavorites, objShortcut, strFavLink, strTitle

	Set objFSO = CreateObject("Scripting.FileSystemObject")

	Set objShell = CreateObject("WScript.Shell")

	strFavorites = objShell.ExpandEnvironmentStrings("%USERPROFILE%") & "\Favorites\"

	strFavLink = Replace(strURL, """", "")

	' Use two checks to see if the target path is a file, not a web link

	If Mid(strFavLink, 2, 1) = ":" Or InStr(strFavLink, "\") > 0 Then

		strTitle = Replace(LCase(strFavLink), "file://", "")

		If Right(strTitle, 1) = "\" Then strTitle = Left(strTitle, Len(strTitle) - 1)

		strTitle = Replace(Replace(strTitle, "\", "_"), ":", "-") & ".lnk"

	Else

		strTitle = Replace(LCase(strFavLink), "http://", "")

		If Right(strTitle, 1) = "/" Then strTitle = Left(strTitle, Len(strTitle) - 1)

		strTitle = Replace(Replace(strTitle, "/", "_"), ":", "-") & ".url"

	End If

	' MsgBox "Adding " & strFavLink & " as " & strTitle

	' Create and save the shortcut file

	Set objShortcut = objShell.CreateShortcut(strFavorites & strTitle)

	objShortcut.TargetPath = strURL

	objShortcut.Save

	Set objShortcut = Nothing

End Sub

'==========================================================

Open in new window

0
 

Author Comment

by:Zak
ID: 22708021
Hi Rob,
Another concern that is looming now is to Allow logon script to continue after calling subroutine, in this case the delay will not be noticeable and the shortcut gets created in the back ground.
Let me know if this is already covered. Thanks for your help.
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 22708051
Hi, I'm not sure I follow what you mean.....

The normal sequence of events when you call a subroutine is this:
1. The call to the sub routine is executed
2. The code in the sub routine completes
3. Execution then returns to the code after the call to the sub routine

so the main code will always wait for the sub routine to complete, meaning it will wait for the shortcut to be created.  This happens very quickly though, and should not be noticable.

Does that answer your concerns?

Regards,

Rob.
0
 

Author Comment

by:Zak
ID: 22708055
Hi Bob I want this to work only for the desktop shortcut and not for the IE shortcut in favorites. So if you can just modify the script with only the desktop shortcut will be fine.
Sorry about that.
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 22708111
Oh, I think I understand now....sorry....I have changed the new section around a bit to this:

'==========================================================
' Run the new section to update desktop shortcuts
Set objFSO = CreateObject("Scripting.FileSystemObject")
strGuide = "C:\Apps\GUIDE.pdf"
If objFSO.FileExists(strGuide) = True Then Change_Desktop_Links
 
'==========================================================
' Run the new section to add URLs to Favorites
If objFSO.FileExists(strGuide) = True Then Add_URL_To_Favorites strGuide
 
'==========================================================


so that it will modify the desktop shortcut, and add the IE favorite shortcut, *only* if the C:\Apps\Guide.pdf file exists.

Regards,

Rob.
'==========================================================

'==========================================================

' default logon script 

'==========================================================

Option Explicit		' This ensures that ALL variables have to be declared, this prevents random variables being used.

On Error Resume Next  

Const cDebug = False

If cDebug Then On Error Goto 0	' tells scripting engine to complete the script without prompting the user even when it finds an error!

Dim Title, Version, DlgTitle

Title = "x Logon Script"

Version = "v2.1b"	' (08/09/2008)

DlgTitle = Title & " " & Version

 

'==========================================================

'==========================================================

' INITIALISATION - set standard variables

'==========================================================

' establish path to current Netlogon folder

Dim NetLogon,LogonServer,ServerString

Dim RegX

Set RegX = New RegExp

Dim SearchPattern, ReplacedText,ReplaceString

' establish path to current Netlogon folder

NetLogon = LCase(Mid(Wscript.ScriptFullName, 1, InStrRev(Wscript.ScriptFullName,"\")))

 

'Include standard files:

Dim oTmp : Set oTmp = WScript.CreateObject("Scripting.FileSystemObject")

 

'Set WSiexplore = CreateObject("InternetExplorer.Application")

'Set objEnv = WSshell.Environment("System")

Dim aFileName,aFile

aFileName = NetLogon & "includes\default.vbs"

If oTmp.FileExists(aFileName) Then

	Set aFile = oTmp.OpenTextFile(aFileName)

	ExecuteGlobal aFile.ReadAll

	aFile.Close

Else

	MsgBox "ERROR: library file not found - " & aFileName & ". Please report this error to Service Desk."

 	Wscript.quit

End If

'==========================================================

'==========================================================

' MAIN - run by all users on all sites on all clients

'==========================================================

	' Create logon box

	Dim GreetingTime

	GreetingTime = "evening"

	If Hour(Now) <= 18 Then GreetingTime = "afternoon"

	If Hour(Now) <= 11 Then GreetingTime = "morning"

	Select Case fnRegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Apps\LogonScript\View")

		Case "Min"

			Call fnCreateMonitorMin(DlgTitle)

		Case Else

			Call fnCreateMonitor(DlgTitle)

	End Select

	fnUpdateAction "Running script " & ScriptFullName

	fnLogLine "  " & Date & " - " & Time

	fnAddLine "Good " & GreetingTime & " " & UCase(UserName)

	fnLogLine "  Machine Name: " & UCase(MachineName) & " (" & OSVersion & " " & SPNumber & ")"

	If Site <> "" Then fnAddLine "Welcome to " & Site

'==========================================================

' GLOBAL SCRIPTS - run by all users on all sites on all clients

'==========================================================

'==========================================================

	fnUpdateDetail "Creating groups list..."

	oShell.run "wscript.exe //b /nologo " & Netlogon & "general\groups.vbs", 0, False

	PctDone = PctDone + PctStep : fnUpdateProgressBar PctDone  ' advance progbar

'==========================================================

	' run groups based processing...

	fnIncludeScript Netlogon & "general\groups.vbs"

	PctDone = PctDone + PctStep : fnUpdateProgressBar PctDone  ' advance progbar

'==========================================================

	fnUpdateDetail "Create Locator shortcut..."

	Set oShortcut = oShell.CreateShortcut(DesktopFolder & "\finder.url")

	oShortcut.TargetPath = "http://Getranet/finder/"

	oShortcut.Save

'==========================================================

	'	Load Geranet frontpage...

	Dim oIE,lCount			                   'Internet Explorer object and Loop count

	lcount = 0

        Set oIE = WScript.CreateObject("InternetExplorer.Application")

	If not DenyHalnet Then

		If TestHalnetLaunch2 then

                    oIE.navigate "http://Geranet"	   'window is hidden

	            Do While (oIE.Busy) and lcount	< 600

			lcount = lcount + 1

                        WScript.Sleep 200	           'wait 200 milliseconds

                    Loop

                    If oIE.Busy then

                        oIE.Stop

                    else

                        oIE.Quit			   'close hidden IE window

                    End If

                    fnUpdateDetail "Loading Geranet..."

		    WScript.Sleep 2000                     'wait 2 secs

                    Set oIE = WScript.CreateObject("InternetExplorer.Application")

                    lcount = 0

                    oIE.Navigate "http://Geranet"

		    Do While oIE.Busy and lcount < 600

			lcount = lcount + 1

                        WScript.Sleep 200	           'wait 200 milliseconds

		    Loop

		    If oIE.Busy then

                        oIE.Stop

                    else

                        oIE.Visible = True                 'Display Halnet page

                    End If

		else 'launch Halnet using original method

                    fnUpdateDetail "Loading Geranet..."

                    oShell.run "http://Geranet", 4, False

                End If

	End If

	Set oIE = Nothing

	PctDone = PctDone + PctStep : fnUpdateProgressBar PctDone  ' advance progbar

 

'==========================================================

' Run the new section to update desktop shortcuts

Set objFSO = CreateObject("Scripting.FileSystemObject")

strGuide = "C:\Apps\GUIDE.pdf"

If objFSO.FileExists(strGuide) = True Then Change_Desktop_Links

 

'==========================================================

' Run the new section to add URLs to Favorites

If objFSO.FileExists(strGuide) = True Then Add_URL_To_Favorites strGuide

 

'==========================================================

'==========================================================

' FINISH SCRIPT

'==========================================================

	fnUpdateDetail ""

	fnUpdateProgressBar 100  ' advance progbar

	fnAddLine ""

	fnAddLine "Logon complete...closing now..."

	fnLogLine Date & " @ " & Time

	Wscript.Quit(0)

	

'==========================================================

'==========================================================

' PROCEDURE TO CHANGE DESKTOP SHORTCUTS

Sub Change_Desktop_Links()

	' Create Objects

	Dim objNetwork, objFSO, WshShell, strDesktop, strTest, oUrlLink

	Set objNetwork = Wscript.CreateObject("Wscript.Network")

	Set objFSO = CreateObject("Scripting.FileSystemObject")

	Set WshShell = WScript.CreateObject("WScript.Shell")

 

	' Set Variables

	strDesktop = WshShell.SpecialFolders("Desktop")

 

	' Process

	strTest = Mid(objNetwork.ComputerName, 1, 3)

	If UCase(strTest) = "M00" Or UCase(strTest) = "M01" Then

	    If objFSO.FileExists(strDesktop & "\Guide.lnk") Then

	        set oUrlLink = WshShell.CreateShortcut(strDesktop & "\Guide.lnk")

	        oUrlLink.TargetPath = "C:\apps\guide.pdf"

	        oUrlLink.Save

	    End If

	Else

	    'Do Nothing

	End If

End Sub

'==========================================================

 

'==========================================================

'==========================================================

' PROCEDURE TO ADD IE FAVORITE

Sub Add_URL_To_Favorites(strURL)

	Dim objFSO, objShell, strFavorites, objShortcut, strFavLink, strTitle

	Set objFSO = CreateObject("Scripting.FileSystemObject")

	Set objShell = CreateObject("WScript.Shell")

	strFavorites = objShell.ExpandEnvironmentStrings("%USERPROFILE%") & "\Favorites\"

	strFavLink = Replace(strURL, """", "")

	' Use two checks to see if the target path is a file, not a web link

	If Mid(strFavLink, 2, 1) = ":" Or InStr(strFavLink, "\") > 0 Then

		strTitle = Replace(LCase(strFavLink), "file://", "")

		If Right(strTitle, 1) = "\" Then strTitle = Left(strTitle, Len(strTitle) - 1)

		strTitle = Replace(Replace(strTitle, "\", "_"), ":", "-") & ".lnk"

	Else

		strTitle = Replace(LCase(strFavLink), "http://", "")

		If Right(strTitle, 1) = "/" Then strTitle = Left(strTitle, Len(strTitle) - 1)

		strTitle = Replace(Replace(strTitle, "/", "_"), ":", "-") & ".url"

	End If

	' MsgBox "Adding " & strFavLink & " as " & strTitle

	' Create and save the shortcut file

	Set objShortcut = objShell.CreateShortcut(strFavorites & strTitle)

	objShortcut.TargetPath = strURL

	objShortcut.Save

	Set objShortcut = Nothing

End Sub

'==========================================================

Open in new window

0
 
LVL 65

Accepted Solution

by:
RobSampson earned 500 total points
ID: 22708113
Ooops, forgot to declare the variables.....


'==========================================================

'==========================================================

' default logon script 

'==========================================================

Option Explicit		' This ensures that ALL variables have to be declared, this prevents random variables being used.

On Error Resume Next  

Const cDebug = False

If cDebug Then On Error Goto 0	' tells scripting engine to complete the script without prompting the user even when it finds an error!

Dim Title, Version, DlgTitle

Title = "x Logon Script"

Version = "v2.1b"	' (08/09/2008)

DlgTitle = Title & " " & Version

 

'==========================================================

'==========================================================

' INITIALISATION - set standard variables

'==========================================================

' establish path to current Netlogon folder

Dim NetLogon,LogonServer,ServerString

Dim RegX

Set RegX = New RegExp

Dim SearchPattern, ReplacedText,ReplaceString

' establish path to current Netlogon folder

NetLogon = LCase(Mid(Wscript.ScriptFullName, 1, InStrRev(Wscript.ScriptFullName,"\")))

 

'Include standard files:

Dim oTmp : Set oTmp = WScript.CreateObject("Scripting.FileSystemObject")

 

'Set WSiexplore = CreateObject("InternetExplorer.Application")

'Set objEnv = WSshell.Environment("System")

Dim aFileName,aFile

aFileName = NetLogon & "includes\default.vbs"

If oTmp.FileExists(aFileName) Then

	Set aFile = oTmp.OpenTextFile(aFileName)

	ExecuteGlobal aFile.ReadAll

	aFile.Close

Else

	MsgBox "ERROR: library file not found - " & aFileName & ". Please report this error to Service Desk."

 	Wscript.quit

End If

'==========================================================

'==========================================================

' MAIN - run by all users on all sites on all clients

'==========================================================

	' Create logon box

	Dim GreetingTime

	GreetingTime = "evening"

	If Hour(Now) <= 18 Then GreetingTime = "afternoon"

	If Hour(Now) <= 11 Then GreetingTime = "morning"

	Select Case fnRegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Apps\LogonScript\View")

		Case "Min"

			Call fnCreateMonitorMin(DlgTitle)

		Case Else

			Call fnCreateMonitor(DlgTitle)

	End Select

	fnUpdateAction "Running script " & ScriptFullName

	fnLogLine "  " & Date & " - " & Time

	fnAddLine "Good " & GreetingTime & " " & UCase(UserName)

	fnLogLine "  Machine Name: " & UCase(MachineName) & " (" & OSVersion & " " & SPNumber & ")"

	If Site <> "" Then fnAddLine "Welcome to " & Site

'==========================================================

' GLOBAL SCRIPTS - run by all users on all sites on all clients

'==========================================================

'==========================================================

	fnUpdateDetail "Creating groups list..."

	oShell.run "wscript.exe //b /nologo " & Netlogon & "general\groups.vbs", 0, False

	PctDone = PctDone + PctStep : fnUpdateProgressBar PctDone  ' advance progbar

'==========================================================

	' run groups based processing...

	fnIncludeScript Netlogon & "general\groups.vbs"

	PctDone = PctDone + PctStep : fnUpdateProgressBar PctDone  ' advance progbar

'==========================================================

	fnUpdateDetail "Create Locator shortcut..."

	Set oShortcut = oShell.CreateShortcut(DesktopFolder & "\finder.url")

	oShortcut.TargetPath = "http://Getranet/finder/"

	oShortcut.Save

'==========================================================

	'	Load Geranet frontpage...

	Dim oIE,lCount			                   'Internet Explorer object and Loop count

	lcount = 0

        Set oIE = WScript.CreateObject("InternetExplorer.Application")

	If not DenyHalnet Then

		If TestHalnetLaunch2 then

                    oIE.navigate "http://Geranet"	   'window is hidden

	            Do While (oIE.Busy) and lcount	< 600

			lcount = lcount + 1

                        WScript.Sleep 200	           'wait 200 milliseconds

                    Loop

                    If oIE.Busy then

                        oIE.Stop

                    else

                        oIE.Quit			   'close hidden IE window

                    End If

                    fnUpdateDetail "Loading Geranet..."

		    WScript.Sleep 2000                     'wait 2 secs

                    Set oIE = WScript.CreateObject("InternetExplorer.Application")

                    lcount = 0

                    oIE.Navigate "http://Geranet"

		    Do While oIE.Busy and lcount < 600

			lcount = lcount + 1

                        WScript.Sleep 200	           'wait 200 milliseconds

		    Loop

		    If oIE.Busy then

                        oIE.Stop

                    else

                        oIE.Visible = True                 'Display Halnet page

                    End If

		else 'launch Halnet using original method

                    fnUpdateDetail "Loading Geranet..."

                    oShell.run "http://Geranet", 4, False

                End If

	End If

	Set oIE = Nothing

	PctDone = PctDone + PctStep : fnUpdateProgressBar PctDone  ' advance progbar

 

'==========================================================

' Run the new section to update desktop shortcuts

Dim objFSO, strGuide

Set objFSO = CreateObject("Scripting.FileSystemObject")

strGuide = "C:\Apps\GUIDE.pdf"

If objFSO.FileExists(strGuide) = True Then Change_Desktop_Links

 

'==========================================================

' Run the new section to add URLs to Favorites

If objFSO.FileExists(strGuide) = True Then Add_URL_To_Favorites strGuide

 

'==========================================================

'==========================================================

' FINISH SCRIPT

'==========================================================

	fnUpdateDetail ""

	fnUpdateProgressBar 100  ' advance progbar

	fnAddLine ""

	fnAddLine "Logon complete...closing now..."

	fnLogLine Date & " @ " & Time

	Wscript.Quit(0)

	

'==========================================================

'==========================================================

' PROCEDURE TO CHANGE DESKTOP SHORTCUTS

Sub Change_Desktop_Links()

	' Create Objects

	Dim objNetwork, objFSO, WshShell, strDesktop, strTest, oUrlLink

	Set objNetwork = Wscript.CreateObject("Wscript.Network")

	Set objFSO = CreateObject("Scripting.FileSystemObject")

	Set WshShell = WScript.CreateObject("WScript.Shell")

 

	' Set Variables

	strDesktop = WshShell.SpecialFolders("Desktop")

 

	' Process

	strTest = Mid(objNetwork.ComputerName, 1, 3)

	If UCase(strTest) = "M00" Or UCase(strTest) = "M01" Then

	    If objFSO.FileExists(strDesktop & "\Guide.lnk") Then

	        set oUrlLink = WshShell.CreateShortcut(strDesktop & "\Guide.lnk")

	        oUrlLink.TargetPath = "C:\apps\guide.pdf"

	        oUrlLink.Save

	    End If

	Else

	    'Do Nothing

	End If

End Sub

'==========================================================

 

'==========================================================

'==========================================================

' PROCEDURE TO ADD IE FAVORITE

Sub Add_URL_To_Favorites(strURL)

	Dim objFSO, objShell, strFavorites, objShortcut, strFavLink, strTitle

	Set objFSO = CreateObject("Scripting.FileSystemObject")

	Set objShell = CreateObject("WScript.Shell")

	strFavorites = objShell.ExpandEnvironmentStrings("%USERPROFILE%") & "\Favorites\"

	strFavLink = Replace(strURL, """", "")

	' Use two checks to see if the target path is a file, not a web link

	If Mid(strFavLink, 2, 1) = ":" Or InStr(strFavLink, "\") > 0 Then

		strTitle = Replace(LCase(strFavLink), "file://", "")

		If Right(strTitle, 1) = "\" Then strTitle = Left(strTitle, Len(strTitle) - 1)

		strTitle = Replace(Replace(strTitle, "\", "_"), ":", "-") & ".lnk"

	Else

		strTitle = Replace(LCase(strFavLink), "http://", "")

		If Right(strTitle, 1) = "/" Then strTitle = Left(strTitle, Len(strTitle) - 1)

		strTitle = Replace(Replace(strTitle, "/", "_"), ":", "-") & ".url"

	End If

	' MsgBox "Adding " & strFavLink & " as " & strTitle

	' Create and save the shortcut file

	Set objShortcut = objShell.CreateShortcut(strFavorites & strTitle)

	objShortcut.TargetPath = strURL

	objShortcut.Save

	Set objShortcut = Nothing

End Sub

'==========================================================

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently I finished a vbscript that I thought I'd share.  It uses a text file with a list of server names to loop through and get various status reports, then writes them all into an Excel file.  Originally it was put together for our Altiris server…
I met Paul Devereux (@pdevereux) today when I responded to his tweet asking “Anybody know how to automate adding files from disk to a folder in #outlook  ?”.  I replied back and told Paul that using automation, in this case scripting, to add files t…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now