Question : Script through SCCM will not copy files.

Alrighty.  I'm missing something here and I can't figure out what it is.  Basically I'm trying to deploy an app that's a simple .exe (no installer) to my client machines.  When I run it manually, it works fine.  But if I advertise it, all it does is create the directories and never copies the files.  SCCM returns a positive result because the script completed though.  So what am I missing?  The install account has admin rights.

Anyone have any ideas?
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
Option Explicit
On Error Resume Next
Const OverwriteExisting = True 

'**************************************************
'Declare Global Objects
'**************************************************
Dim TrueCrypt
Dim DriverFile
Dim Shortcut
Dim fso
Dim objFolder
Dim ShortCutFolder
Dim strDirectory
Dim strTCShortcutDir

'**************************************************
'*Create Object Definitions
'**************************************************
TrueCrypt = "\\share\TrueCrypt\ScriptFiles\TrueCrypt.exe"
DriverFile = "\\share\TrueCrypt\ScriptFiles\truecrypt.sys"
Shortcut = "\\share\TrueCrypt\ScriptFiles\TrueCrypt.lnk"
Set fso = CreateObject("Scripting.FileSystemObject") 
strDirectory = "C:\Program Files\TrueCrypt"
strTCShortcutDir = "C:\Documents and Settings\All Users\Start Menu\Programs\TrueCrypt\"
Set objFolder = fso.CreateFolder(strDirectory)
Set ShortCutFolder = fso.CreateFolder(strTCShortcutDir)


'****************************************************
'*Begin Installation - Create Program Files Directory
'****************************************************

If fso.FolderExists(strDirectory) Then
   Set objFolder = fso.GetFolder(strDirectory)
   'WScript.Echo strDirectory & " already created "
Else
   Set objFolder = fso.CreateFolder(strDirectory)
End If

'****************************************************
'*Create Shortcut Directory
'****************************************************

If fso.FolderExists(strTCShortcutDir) Then
   Set ShortCutFolder = fso.GetFolder(strTCShortcutDir)
   'WScript.Echo strTCShortcutDir & " already created "
Else
   Set ShortCutFolder = fso.CreateFolder(strTCShortcutDir)
End If

'************************
'*Copy Files
'************************

'wscript.Echo "Copying Executable"
fso.CopyFile TrueCrypt , "C:\Program Files\TrueCrypt\", OverwriteExisting 
'wscript.Echo "Copying Driver"
fso.CopyFile DriverFile , "C:\Program Files\TrueCrypt\", OverwriteExisting 
'wscript.Echo "Copying Shortcut for Program Files"
fso.CopyFile Shortcut , "C:\Program Files\TrueCrypt\", OverwriteExisting
'wscript.Echo "Copying Shortcut for Start Menu"
fso.CopyFile Shortcut , "C:\Documents and Settings\All Users\Start Menu\Programs\TrueCrypt\", OverwriteExisting

Answer : Script through SCCM will not copy files.

How is the SCC program configured to run, if it's running as an administrator then it's running under the computers system context, so the share \\share\TrueCrypt must have read access for Domain Computers both at the share level and NTFS level.   I'm guessing this is your issue.
Random Solutions  
 
programming4us programming4us