Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logon Script file copy error 1

Status
Not open for further replies.

QCumber

Technical User
Apr 23, 2003
45
GB
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.

 
%logonscript% is an environmental variable that needs to be called from objShell.

set objShell = CreateObject("Wscript.Shell")
strLogonServer = objShell.ExpandEnvironmentStrings("%Logonserver%")

-Geates
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top