Hi there,
I'm trying to write a script segment that will eventually be added to our logon scripts to copy and register an OCX file.
The script works OK using local paths (ie copying the file from c:\temp to %SystemDirectory%), but when I try a similar task from the Sysvol\domainname\scripts folder I keep getting a "path not found, code 800A004C error at line 12 char 2 (see below).
The script has been replicated to both DCs, and the source file exists in its proper lacation on both DCs (netlogon\OCX\msflxgrd.ocx.
Can anyone spot my mistake?
Option Explicit
Dim objFSO, shell
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set Shell = CreateObject("Wscript.Shell")
'###################################
'Copy and register MSFLXGRD.OCX
'###################################
If (Not objFSO.FileExists("%SystemDirectory%\MSFLXGRD.OCX")) Then
objFSO.Copyfile "%logonserver%\netlogon\OCX\MSFLXGRD.OCX", "c:\windows\system32\"
Shell.Run "regsvr32.exe /s" & chr(34) & "%SystemDirectory%\MSFLXGRD.OCX" & chr(34)
End If
'#########################################
'Copy and register MSFLXGRD.OCX - END
'#########################################
Cheers,
Q.
I'm trying to write a script segment that will eventually be added to our logon scripts to copy and register an OCX file.
The script works OK using local paths (ie copying the file from c:\temp to %SystemDirectory%), but when I try a similar task from the Sysvol\domainname\scripts folder I keep getting a "path not found, code 800A004C error at line 12 char 2 (see below).
The script has been replicated to both DCs, and the source file exists in its proper lacation on both DCs (netlogon\OCX\msflxgrd.ocx.
Can anyone spot my mistake?
Option Explicit
Dim objFSO, shell
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set Shell = CreateObject("Wscript.Shell")
'###################################
'Copy and register MSFLXGRD.OCX
'###################################
If (Not objFSO.FileExists("%SystemDirectory%\MSFLXGRD.OCX")) Then
objFSO.Copyfile "%logonserver%\netlogon\OCX\MSFLXGRD.OCX", "c:\windows\system32\"
Shell.Run "regsvr32.exe /s" & chr(34) & "%SystemDirectory%\MSFLXGRD.OCX" & chr(34)
End If
'#########################################
'Copy and register MSFLXGRD.OCX - END
'#########################################
Cheers,
Q.