Hi Ashpoint,
However, I want to run the file from a desktop shortcut so right-clicking
the .bat and selecting "Run as administrator" would not be my ideal
answer.
You can get the same effect by including a "runas" command in your batch
file:
C:\>runas /user:Mydomain\Administrator "XCOPY \\server\network\Files\*.*
"%userprofile%\My Documents\Files\" /D /E /V /F /R /Y"
You need to enter the password for the Administrator, interactively.
I read elsewhere that I should "Take Ownership" of the folder and haven't
tried this. Any comment, please.
There are 2 main options:
1) you can grant the user context of your XCOPY command the permissions
needed to read the files from your file server and/or write to your user
Documents directory. This would be the "standard" way of resolving
permissions issues - explicitly and administratively granting permissions to
the users who require them.
2) as administrator, you can take ownership and change permissions on an ad
hoc basis, from the command line. Use the "takeown" command to take
ownership of files and directories from teh command line. Use the "icacls"
command to change permissions on files and directories from the command
line. icacls syntax is a little bit convoluted so you'll probably need to
experiemnt, to find the right command syntax for your situation.
I'm not connected to the server for a few days so can't experiment but I
did
try running as administrator with the same negative result - permissions
issue.
Vista has shifted the permissions philosopy in Windows from Discretionary
Access Control ("DAC") towards Mandatory Access Control ("MAC"). An aspect
of this is that you don't automatically get permssions to do whatever you
want, just because you are the Administrator. Even the Administrator may
need to explcitly ask for permission to do something. If you are
Administrator, there's not much you can't ultimately take control of ... but
you might not get it by default, out of the box.
MAC security shemes have been common in highly-secure minicoputer
environments since the 1980s. But this is the first time we're seeing MAC in
a widespread mass-market desktop operating system. So it takes some people
by surprise. It's a bit like running Secure VMS on a VAX, circa 1991
As "swingman" suggested, Microsoft's free SyncToy may be a usefuly
replacement for your batch file. I've used SyncToy with great success, it's
an excellent little utility.
Hope it helps,