I am trying to copy a file from \\servername\folder\myfile.txt to c:\windows in some cases and c:\winnt in other cases. Is there a way to make this work using %systemroot% in a vbs script instead of C:\Windows\?
What I have so far is:
Const OverwriteExisting = TRUE
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "\\servername\folder\myfile.txt" , "C:\Windows\", OverwriteExisting
This works but I need to be able to use %systemroot% in place of C:\Windows\ so it will work arcross various OS platforms.
Thx
What I have so far is:
Const OverwriteExisting = TRUE
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "\\servername\folder\myfile.txt" , "C:\Windows\", OverwriteExisting
This works but I need to be able to use %systemroot% in place of C:\Windows\ so it will work arcross various OS platforms.
Thx