Aladdin420
Programmer
Hey guys, this question may be a toughy, at least to me it is. I am trying to copy one file, "Machine.lst", to one folder, "information". Simple, right? Wrong!!
I want to copy the file, but I want the file to first go through a script, "SmartCopy.prg". This script copies a file to a folder. It is built to accept two arguments, the source of the file, "fc_source", and the destination, "fc_target".
Here's the code:
Dim objSC, blah, sCCSserver, sMachine, Copier, oFSo
Set oFSo = CreateObject("Scripting.FileSystemObject"
Set objSC = CreateObject("MSScriptControl.ScriptControl"
Set oShell = CreateObject("Wscript.Shell"
objSC.Language = "VBScript"
blah1 = "Function Load(fc_source, fc_target)"& vbNewLine & "Load = c:\project\SmartCopy.prg"
blah1 = blah1 & ": End Function"
objSC.AddCode blah1
Wscript.Echo objSC.Run("Load", "c:\Machine.LST", "c:\information\"
It doesn't work!! Here's the error it spits out:
"Micorosoft VBScript compilation error: Expected statment"
I'm open to "ALL" suggestions.
Thanks everyone
I want to copy the file, but I want the file to first go through a script, "SmartCopy.prg". This script copies a file to a folder. It is built to accept two arguments, the source of the file, "fc_source", and the destination, "fc_target".
Here's the code:
Dim objSC, blah, sCCSserver, sMachine, Copier, oFSo
Set oFSo = CreateObject("Scripting.FileSystemObject"
Set objSC = CreateObject("MSScriptControl.ScriptControl"
Set oShell = CreateObject("Wscript.Shell"
objSC.Language = "VBScript"
blah1 = "Function Load(fc_source, fc_target)"& vbNewLine & "Load = c:\project\SmartCopy.prg"
blah1 = blah1 & ": End Function"
objSC.AddCode blah1
Wscript.Echo objSC.Run("Load", "c:\Machine.LST", "c:\information\"
It doesn't work!! Here's the error it spits out:
"Micorosoft VBScript compilation error: Expected statment"
I'm open to "ALL" suggestions.
Thanks everyone