How can I easily push out a new c:\windows\system32\drivers\etc\hosts file to my workstations?

Comments

6 comments

  • Adam Ruth

    Aaron,

    It may be that the deployment credentials can't access the server share.  You can try adding the hosts file as an "Additional File".  It will be copied down to the target computer and then you can do the copy from there, so that the target computer doesn't need to connect to the share.

    copy hosts "%windir%\System32\drivers\etc\hosts" /Y

    If you're still having an issue you can capture the output from the command to see if there's something else blocking the copy:

    copy hosts "%windir%\System32\drivers\etc\hosts" /Y > c:\copy.log 2>&1

    This will put a file called copy.log in the c:\ directory on the target computer where you can read any error messages.

    0
    Comment actions Permalink
  • Aaron Young

    When you say "You can try adding the hosts file as "Additional File" do you mean put it in the "Files to include" field?

    0
    Comment actions Permalink
  • Adam Ruth

    Yes, that's correct.  The label was changed and I was using the old name.

    0
    Comment actions Permalink
  • Aaron Young

     Hmmm....didn't help.  I even thought it was a pro versus free version thing and upgraded to Pro.  Didn't help at all.

    0
    Comment actions Permalink
  • Adam Ruth

    Did you try to capture a log file?  I just noticed I had a typo in the syntax, it should end with 2>&1 instead of 2&>1 (I corrected the original comment).

    copy hosts "%windir%\System32\drivers\etc\hosts" /Y > c:\copy.log 2>&1
    0
    Comment actions Permalink
  • Aaron Young

    When I corrected that syntax, it looks like it worked. 

    1 file(s) copied.

    Thanks dude!  

    0
    Comment actions Permalink

Please sign in to leave a comment.