I have this script below and it works fine like this:
===========================
'Adds the HOSTS file
Const OverwriteExisting = TRUE
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "\\server\updates\hosts", "c:\windows\system32\drivers\etc\", OverwriteExisting
'This copies the SDAT.exe file to C:\ and then installes it with a silent switch
objFSO.CopyFile "\\server\updates\sdat.exe" , "c:\", OverwriteExisting
set wshshell=createobject("wscript.shell")
wshshell.run "c:\sdat.exe -s",,true
set wshshell=Nothing
=================================
But when I try to use the %windir% or %systemroot% for the hosts file placement it won't work ... Anybody have suggestions? It errors with Line 5 Char 1 path not found.
I have tried:
objFSO.CopyFile "\\server\updates\hosts", "c:\%windir%\system32\drivers\etc\", OverwriteExisting
objFSO.CopyFile "\\server\updates\hosts", "c:\%systemroot%\system32\drivers\etc\", OverwriteExisting
I've tried it without the drive letter ....
objFSO.CopyFile "\\server\updates\hosts", "%systemroot%\system32\drivers\etc\", OverwriteExisting
Thanks in advance!
Tommy
===========================
'Adds the HOSTS file
Const OverwriteExisting = TRUE
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "\\server\updates\hosts", "c:\windows\system32\drivers\etc\", OverwriteExisting
'This copies the SDAT.exe file to C:\ and then installes it with a silent switch
objFSO.CopyFile "\\server\updates\sdat.exe" , "c:\", OverwriteExisting
set wshshell=createobject("wscript.shell")
wshshell.run "c:\sdat.exe -s",,true
set wshshell=Nothing
=================================
But when I try to use the %windir% or %systemroot% for the hosts file placement it won't work ... Anybody have suggestions? It errors with Line 5 Char 1 path not found.
I have tried:
objFSO.CopyFile "\\server\updates\hosts", "c:\%windir%\system32\drivers\etc\", OverwriteExisting
objFSO.CopyFile "\\server\updates\hosts", "c:\%systemroot%\system32\drivers\etc\", OverwriteExisting
I've tried it without the drive letter ....
objFSO.CopyFile "\\server\updates\hosts", "%systemroot%\system32\drivers\etc\", OverwriteExisting
Thanks in advance!
Tommy