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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FileSystemObject Server 2003 R2

Status
Not open for further replies.

spazman

Programmer
May 29, 2001
500
CA
Okay, I wrote a very simple script that copies a file from one spot to another. I try to run it on the server and I get an error 'Could not create object named "Scripting.FileSystemObject"'

The Line is;
Set FSO = WScript.CreateObject("Scripting.FileSystemObject")

If I use just'
Set FSO = CreateObject("Scripting.FileSystemObject")
I get the error "The specified module could not be found"

I have serach Microcoft,com google and here and I can't find what I am missing.

 
Option Explicit
Set FSO = CreateObject("Scripting.FileSystemObject")
FileLog = "C:\Scripts\wip.log"

Set LogFile = FSO.OpenTextFile(FileLog, 8)

strLocation = "\\NETAPPFILER\data\Engr\Liaison\WIP.xls"
StrDestination = "\\NETAPPFILER\data\Data\ENGR\"

FSO.CopyFile strLocation , strDestination, true

Set CheckFile = FSO.GetFile(StrLocation)
FileName = CheckFile.Name
Set DestFile = FSO.GetFile(StrDestination & FileName)

IF CheckFile.DateLastModified = DestFile.DateLastModified Then
LogFile.Write "File Copied Succesfully on " & Now() & VbCrLf
Else
LogFile.Write "*** File Did Not Copy Succesfully on " & Now() & VbCrLf
End If

Logfile.Close()

Set CheckFile = Nothing
Set DestFile = Nothing
Set LogFile = Nothing
Set FSO = Nothing
 
It appears to be an R2 issue, I can run it on a W2K satraion and 2003 server non R2
 
There is an Option Explicit and no dim statements and it still run on ...?

>'Could not create object named "Scripting.FileSystemObject"
Have to register scrrun.dll. Otherwise, it is the permission to accessing it.
 
Yeah,

I had not pasted in the DIM statements, I was taking comments out and took those with it. I registered scrrun.dll and it worked.

Thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top