Login Script

Posted on 2014-04-16
Medium Priority
Last Modified: 2014-04-23
Can anyone check the below login script and advise for correction

i tried the below but not working

it says :-the syntax of the command is incorrect

rename c:\windows\system32\drivers\etc\hosts C:\windows\system32\drivers\etc\hosts_original
copy \\data-svr01\share\Hosts c:\windows\system32\drivers\etc\ /Y
Question by:Aditya Arora
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 12

Expert Comment

ID: 40004035
rename c:\windows\system32\drivers\etc\hosts C:\windows\system32\drivers\etc\hosts_original

Will not work as it gives syntax error.

replace above by this

cd c:\windows\system32\drivers\etc
rename hosts hosts_original

and then try

Author Comment

by:Aditya Arora
ID: 40005893
No not working.

Author Comment

by:Aditya Arora
ID: 40005895
I am tring to block facebook by host file
LVL 18

Accepted Solution

Mike T earned 2000 total points
ID: 40007097

You do not need to specify the destination path, i.e.

rename c:\windows\system32\drivers\etc\hosts hosts_original

LVL 16

Expert Comment

ID: 40011483
Mike T has the answer.

Just as an aside, beware that antivirus and security software can monitor your hosts file, so if you're prevented from doing anything to it once you are using the correct syntax, then that's probably why.

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
This Micro Tutorial will go in depth within Systems and Security in Windows 7 and will go into detail regarding Action Center, Windows Firewall, System, etc. This will be demonstrated using Windows 7 operating system.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question