Hi
I have a script which modifies the registry and creates a shortcut for an application. It runs well under xp and if I download it to a Windows 7 box and run it there it works perfectly. However, when I try to schedule it as a task to distribute it , it fails. It fails on a package deployment error 255. Here is an example of the log and script:
Processing package : Cisco Voip Agent Shortcut and Registry Settings
Fri, 15 Mar 2013 13:18:21 Checking preferred server path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs instead of \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:18:29 Path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs was redirected to \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:18:29 File (\\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs) is cached locally
Fri, 15 Mar 2013 13:18:29 Checking preferred server path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs instead of \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:18:29 Path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs was redirected to \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:18:29 Checking preferred server path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs instead of \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:18:29 Path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs was redirected to \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:18:29 ILdDownloading file to C:\Program Files (x86)\LANDesk\LDClient\sdmcache\ldlogon\FileLists\taskmanifest.????????.???.local.254.32.ini, attempt 0
Fri, 15 Mar 2013 13:18:31 ILdDownloadFile returned 0
Fri, 15 Mar 2013 13:18:31
Downloading file \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs (dKDJLYN37s9Shf4xHQZVzg==, 3)
Fri, 15 Mar 2013 13:18:31 Downloading file 1 of 1 from '\\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs'
Fri, 15 Mar 2013 13:18:31 Checking recently used server path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs instead of \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:18:31 Path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs was redirected to \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:18:31 processing of package is complete, result 229392397 (0x0dac400d - code 16397)
Fri, 15 Mar 2013 13:18:31 Checking recently used server path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs instead of \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:18:31 Path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs was redirected to \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:18:31 File (\\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs) is cached locally
Fri, 15 Mar 2013 13:18:31 Checking recently used server path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs instead of \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:18:31 Path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs was redirected to \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:18:31 Checking recently used server path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs instead of \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:18:31 Path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs was redirected to \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:18:31 ILdDownloading file to C:\Program Files (x86)\LANDesk\LDClient\sdmcache\ldlogon\FileLists\taskmanifest.????????.???.local.254.32.ini, attempt 0
Fri, 15 Mar 2013 13:18:32 ILdDownloadFile returned 0
Fri, 15 Mar 2013 13:18:32
Downloading file \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs (dKDJLYN37s9Shf4xHQZVzg==, 3)
Fri, 15 Mar 2013 13:18:32 Downloading file 1 of 1 from '\\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs'
Fri, 15 Mar 2013 13:18:32 Checking recently used server path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs instead of \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:18:32 Path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs was redirected to \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:18:37 Windows Script Output:
Fri, 15 Mar 2013 13:18:37
Fri, 15 Mar 2013 13:18:39 processing of package is complete, result -1917517569 (0x8db500ff - code 255)
Fri, 15 Mar 2013 13:42:57 Checking preferred server path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs instead of \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:42:58 Path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs was redirected to \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:42:58 File (\\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs) is cached locally
Fri, 15 Mar 2013 13:42:58 Checking preferred server path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs instead of \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:42:58 Path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs was redirected to \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:42:58 Checking preferred server path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs instead of \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:42:58 Path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs was redirected to \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:42:58 ILdDownloading file to C:\Program Files (x86)\LANDesk\LDClient\sdmcache\ldlogon\FileLists\taskmanifest.????????.???.local.254.32.ini, attempt 0
Fri, 15 Mar 2013 13:43:00 ILdDownloadFile returned 0
Fri, 15 Mar 2013 13:43:00
Downloading file \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs (dKDJLYN37s9Shf4xHQZVzg==, 3)
Fri, 15 Mar 2013 13:43:00 Downloading file 1 of 1 from '\\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs'
Fri, 15 Mar 2013 13:43:00 Checking recently used server path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs instead of \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:43:00 Path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs was redirected to \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:43:00 processing of package is complete, result 229392397 (0x0dac400d - code 16397)
Fri, 15 Mar 2013 13:43:00 Checking recently used server path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs instead of \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:43:00 Path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs was redirected to \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:43:00 File (\\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs) is cached locally
Fri, 15 Mar 2013 13:43:00 Checking recently used server path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs instead of \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:43:00 Path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs was redirected to \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:43:00 Checking recently used server path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs instead of \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:43:00 Path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs was redirected to \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:43:00 ILdDownloading file to C:\Program Files (x86)\LANDesk\LDClient\sdmcache\ldlogon\FileLists\taskmanifest.????????.???.local.254.32.ini, attempt 0
Fri, 15 Mar 2013 13:43:02 ILdDownloadFile returned 0
Fri, 15 Mar 2013 13:43:02
Downloading file \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs (dKDJLYN37s9Shf4xHQZVzg==, 3)
Fri, 15 Mar 2013 13:43:02 Downloading file 1 of 1 from '\\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs'
Fri, 15 Mar 2013 13:43:02 Checking recently used server path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs instead of \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:43:02 Path \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs was redirected to \\????????.???.local\???_Landesk_Files\Scripts\CiscoVoipParameterUpdate.vbs
Fri, 15 Mar 2013 13:43:05 Windows Script Output:
Fri, 15 Mar 2013 13:43:05
Fri, 15 Mar 2013 13:43:07 processing of package is complete, result -1917517569 (0x8db500ff - code 255)
Here is the script.''
Dim oShell
Dim iValue
On Error Resume Next
Set oShell = CreateObject("WScript.Shell")
iValue = oShell.RegRead("HKLM\SOFTWARE\Calabrio\CAD\Site Setup\LDAP Host 1")
'msgbox("Returned:" & err.description)
If Err.number = 0 then
Err.Clear
On Error Goto 0
'msgbox("Installed on an XP Box")
set oShortCutLink = oShell.CreateShortcut(oShell.SpecialFolders.Item("AllUsersDesktop") & "\Cisco Agent.lnk")
oShortCutLink.TargetPath = "C:\Program Files\Cisco\Desktop\bin\agent.exe"
oShortCutLink.WindowStyle = 1
oShortCutLink.Description = "Cisco Agent"
oShortCutLink.Save
oShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Calabrio\CAD\Site Setup\LDAP Port 1", &H00000bc8, "REG_DWORD"
oShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Calabrio\CAD\Site Setup\LDAP Port 2", &H00000bc8, "REG_DWORD"
oShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Calabrio\CAD\Site Setup\LDAP Host 1","???.???.254.180","REG_SZ"
oShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Calabrio\CAD\Site Setup\LDAP Host 2","???.???.253.180","REG_SZ"
Else
Err.Clear
'msgbox("Testing for Win7")
Set oShell = CreateObject("WScript.Shell")
iValue = oShell.RegRead("HKLM\SOFTWARE\Wow6432Node\Calabrio\CAD\Site Setup\LDAP Host 1")
If Err.number = 0 then
Err.Clear
On Error Goto 0
'msgbox("Installed on an Windows 7 box")
set oShortCutLink = oShell.CreateShortcut(oShell.SpecialFolders.Item("AllUsersDesktop") & "\Cisco Agent.lnk")
oShortCutLink.TargetPath = "C:\Program Files (x86)\Cisco\Desktop\bin\agent.exe"
oShortCutLink.WindowStyle = 1
oShortCutLink.Description = "Cisco Agent"
oShortCutLink.Save
oShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Calabrio\CAD\Site Setup\LDAP Port 1", &H00000bc8, "REG_DWORD"
oShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Calabrio\CAD\Site Setup\LDAP Port 2", &H00000bc8, "REG_DWORD"
oShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Calabrio\CAD\Site Setup\LDAP Host 1","???.???.254.180","REG_SZ"
oShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Calabrio\CAD\Site Setup\LDAP Host 2","???.???.253.180","REG_SZ"
Else
'msgbox("Not installed:" & err.description)
End If
End If
Set oShell = nothing