Hey first post here, also new to scripting.
I'm trying to create a script that reads a text file taking the path
from that file and then copying the file from the path in the text
file to a specific destination.
I've got the reading of the text file down and everything seems to be
ok, except when it goes to copy the file, when it tries to copy the
file I get a Permission Denied message, this is a local copy from root
of C to a temp folder and I'm admin on the machine so I can't
understand why it would be a permission issue.
Here is the script:
Const ForReading = 1
Dim SourceServer
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile _
("c:\test.txt", ForReading)
strNextLine = objTextFile.Readline
arrServiceList = Split(strNextLine , ",")
Wscript.Echo "Server name: " & arrServiceList(0)
set SourceServer = objFSO.GetFile(arrServiceList(0))
Wscript.Echo "Copy " & SourceServer
SourceServer.Copy("C:\temp\test")
Any suggestions are much apprciated.