Dim fso, f, WshShell, WshNetwork, oDrives, vMap, LogsFolder, NewFolder, Prod, Destination, AdminAcct, AdminPwd
'---------------------------------------------------
'
' Below are some variables you need to be aware of and customize before running this script
'
'---------------------------------------------------
AdminAcct = "YourAccount" 'Must have rights to map a drive back to NSCap
AdminPwd = "YourPassword" 'Associated password to the above account
' Prod may need to be changed to D or whatever your production drive is while in automation
' or run GHConfig which I don't yet know how to do here.
' Most Win7 Systems have a recovery partition, so Prod would be D: instead of C
Prod = "c:"
LogsFolder = "z:\AutomationLogs" 'Folder under NSCap to store the logs on the NS/SMP
'---------------------------------------------------
' End Customizations Section
'---------------------------------------------------
NewFolder = "%COMPNAME%_" & Replace("%NOW%",":",".")
Destination = LogsFolder & "\" & NewFolder
Set fso = CreateObject("Scripting.FileSystemObject")
Set WshNetwork = WScript.CreateObject("WScript.Network")
vMap = "Yes"
Set oDrives = WshNetwork.EnumNetworkDrives
For i = 0 to oDrives.Count - 1 Step 2
IF oDrives.Item(i) = "z:" THEN vMap = "No"
Next
IF vMap = "Yes" THEN WshNetwork.MapNetworkDrive "z:", "\\%NSSERVER%\NSCap", ,AdminAcct ,AdminPwd
If (fso.FolderExists(LogsFolder)) Then
Else
fso.CreateFolder(LogsFolder)
End If
fso.CreateFolder(Destination)
On Error Resume Next
fso.Copyfolder Prod & "\Windows\Panther", Destination & "\Panther" 'MiniSetup or SOI troubleshooting
fso.copyfolder "x:\Program Files\Altiris\Altiris Agent\Logs", Destination 'for DS 7.1
fso.copyfolder "x:\Program Files\Symantec\Deployment\Logs", Destination & "\Logs" 'for DS 7.5
fso.copyfile "x:\ghosterr.txt", Destination & "\" 'Ghost troubleshooting
WshNetwork.RemoveNetworkDrive "Z:"
|