Access Denied in Login Script. need to overrite host file

  • Thread starter Thread starter Anthoni
  • Start date Start date
A

Anthoni

We have written a batch file to replace the local hosts
file of a windows xp with the hosts file provided from
the server. But we get error when user logs in giving
access denied while copying the file in the
windows\system21\drivers\etc.

Can anyone help.
When we login as administrator it works fine though..


Regards
..
 
We have written a batch file to replace the local hosts
file of a windows xp with the hosts file provided from
the server. But we get error when user logs in giving
access denied while copying the file in the
windows\system21\drivers\etc.

You would need to authenticate to that server first using credentials
that have access to that share. If it's administrator, you can do
something as easy as

net use x: \\server\admin$ /user:domain\administrator password
copy my_file \\server\admin$\system32\drivers\etc\
net use x: /del

I'd recommend creating some less-powerful user account that has
write-only access to that share, and use that instead of
administrator, so your admin password is not laying around in
cleartext.

You might also look at the RUNAS command.

ws
 
Back
Top