guys i am running a copy command vbscript via SCCM & it's not working. I get the successfull on the deployment but actually it's not copying the file. Please look @ the code that i am trying to execute. SCript works fine manually


Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
FSO.CopyFile "abc.js", "C:\Program Files\Mozilla Firefox\", true
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
That snipet of code may not be telling the whole story. What is the source location you are copying the file(s) from? The source of the file is just as important as the destination.
Answered 05/05/2011 by: Helpy
Senior Yellow Belt

Please log in to comment
0
running it from "system32\ccm\cache\100000.A"
Answered 05/05/2011 by: chichora123
Fourth Degree Green Belt

Please log in to comment
-1
I see we have another scripter who imagines that the scriptingengine can work out for itself where source the file is located. TryFSO.CopyFile "[path_containing_abc.js]abc.js", "C:\Program Files\Mozilla Firefox\", trueOh, and some error-trapping is always good. Like, does the source file exist? What about the target drive? The target path? In time, you'll create your own FileCopy function which has these things built in and you can then stop re-writing it every time you create a script.
Answered 05/06/2011 by: VBScab
Red Belt

  • I like your little "attempting to give a Darn" etc... made me laugh
Please log in to comment
0
I can't tell the source path because it's different for every user. SCCM creates a directory structure under systems/cache folder & the folder name is different everytime you push the package, can't hard code path in my script.
Answered 05/06/2011 by: chichora123
Fourth Degree Green Belt

Please log in to comment
2

Dim sCurPaths
CurPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")
should help you if you prepend this to your copy's source location
Answered 05/06/2011 by: pjgeutjens
Red Belt

Please log in to comment
0
As i understand abc.js and your runnnng script located in the same folder
In this case you can try:



Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
srcFile = FSO.GetFile(Wscript.ScriptFullName).ParentFolder & "\abc.js"
FSO.CopyFile srcFile, "C:\Program Files\Mozilla Firefox\", true

Answered 05/07/2011 by: itolutions
Orange Senior Belt

Please log in to comment
Answer this question or Comment on this question for clarity