Access Denied in Login Script. need to overrite host file

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
..
 
W

wadester

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top