XCOPY fails in Vista

G

Guest

I have used the following .BAT file to update a two folders on my laptop.

Code:
XCOPY \\server\network\Files\*.* "%userprofile%\My Documents\Files\" /D /E
/V /F /R /Y

XCOPY \\server\network\Strata\*.* "%userprofile%\My Documents\Strata\" /D /E
/V /F /R /Y

The file worked for years when the OS was Windows XP Pro.

Now I have a Vista Business system, the process fails with permissions issues.

Please advise where to look for a resolution

Thanks in advance:
 
P

P. Di Stolfo

Hello,

try right-clicking the .bat and selecting "Run as administrator". Will it
work?

Greetings,
P. Di Stolfo
 
S

Saucy

Ashpoint said:
I have used the following .BAT file to update a two folders on my laptop.

Code:
XCOPY \\server\network\Files\*.* "%userprofile%\My Documents\Files\" /D /E
/V /F /R /Y

XCOPY \\server\network\Strata\*.* "%userprofile%\My Documents\Strata\" /D
/E
/V /F /R /Y

The file worked for years when the OS was Windows XP Pro.

Now I have a Vista Business system, the process fails with permissions
issues.

Please advise where to look for a resolution

Thanks in advance:


Create a link to the batch file.

Right-click on the link and select Properties > on the Shortcut tab hit the
Advanced button > check the "Run as administrator" checkbox > click any OKs

Now you run the batch file via the link. 'Hope it works.

Saucy
 
S

Saucy

P. Di Stolfo said:
Hello,

try right-clicking the .bat and selecting "Run as administrator". Will it
work?

Greetings,
P. Di Stolfo

--
//-----------------------------------------------------------------------------------------------------------
// http://blog.lysorp.com - small Windows Blog in German language
//-----------------------------------------------------------------------------------------------------------

Ashpoint said:
I have used the following .BAT file to update a two folders on my laptop.

Code:
XCOPY \\server\network\Files\*.* "%userprofile%\My Documents\Files\" /D
/E
/V /F /R /Y

XCOPY \\server\network\Strata\*.* "%userprofile%\My Documents\Strata\" /D
/E
/V /F /R /Y

The file worked for years when the OS was Windows XP Pro.

Now I have a Vista Business system, the process fails with permissions
issues.

Please advise where to look for a resolution

Thanks in advance:


That should work .. but it can't be run that way automatically .. one must
do it manually. If you adjust a shortcut, the shortcut can be run by some
scheduler etc. etc. At least, that's how I take it.

Saucy
 
G

Guest

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.

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.

I read elsewhere that I should "Take Ownership" of the folder and haven't
tried this. Any comment, please.

P. Di Stolfo said:
Hello,

try right-clicking the .bat and selecting "Run as administrator". Will it
work?

Greetings,
P. Di Stolfo

--
//-----------------------------------------------------------------------------------------------------------
// http://blog.lysorp.com - small Windows Blog in German language
//-----------------------------------------------------------------------------------------------------------

Ashpoint said:
I have used the following .BAT file to update a two folders on my laptop.

Code:
XCOPY \\server\network\Files\*.* "%userprofile%\My Documents\Files\" /D /E
/V /F /R /Y

XCOPY \\server\network\Strata\*.* "%userprofile%\My Documents\Strata\" /D
/E
/V /F /R /Y

The file worked for years when the OS was Windows XP Pro.

Now I have a Vista Business system, the process fails with permissions
issues.

Please advise where to look for a resolution

Thanks in advance:
 
S

Swingman

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.

Strictly FWIW...

Used xcopy in .bat file for years to backup files across networks. Since
getting a laptop with Vista, and on the advice of someone here, and somewhat
reluctantly, I started using SyncToy to sync my laptop and desktop, network
drives, as well as backup files, photos, music to an external USB drive.

I wished I would have switched long ago ... might want to check it out.

http://www.microsoft.com/downloads/...54-C975-4814-9649-CCE41AF06EB7&displaylang=en
 
D

Dave

"My Documents" is no longer a folder in Vista. It is a junction point.
Try saving the files to "Documents"
 
A

Andrew McLaren

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,
 
S

Saucy

Andrew McLaren said:
Hi Ashpoint,


Hope it helps,

Also being discussed is his use of "My Documents" instead of "Documents".
Does Vista use the junction point somehow or will the command flop because
of it?

Saucy
 
A

Andrew McLaren

Saucy said:
Also being discussed is his use of "My Documents" instead of "Documents".
Does Vista use the junction point somehow or will the command flop because
of it?

Excellent point! I didn't even notice that (d'oh).

I haven't tested it exhaustively, but my quick test here showed a batch file
having difficulty reading the junction point. Since the OP is using an
easily edited batch file, and not a compiled app, it's probably better to
specific the *real* file path with a plain "Documents", rather than "My
Documents".

Thanks!
 
X

Xenomorph

I was checking for replies for someone to point out there is no folder
called "My Documents"

And if one tries to access the junction called "My Documents", Windows will
give an "Access Denied" message.

Gee, maybe THAT is why it doesn't work for the original poster...


--
http://xenomorph.net/
Dave said:
"My Documents" is no longer a folder in Vista. It is a junction point.
Try saving the files to "Documents"



Ashpoint said:
I have used the following .BAT file to update a two folders on my laptop.

Code:
XCOPY \\server\network\Files\*.* "%userprofile%\My Documents\Files\" /D
/E
/V /F /R /Y

XCOPY \\server\network\Strata\*.* "%userprofile%\My Documents\Strata\" /D
/E
/V /F /R /Y

The file worked for years when the OS was Windows XP Pro.

Now I have a Vista Business system, the process fails with permissions
issues.

Please advise where to look for a resolution

Thanks in advance:
 
J

Jane C

"My Documents" does not exist in Vista. Try "Documents" instead:

Code:
XCOPY \\server\network\Files\*.* "%userprofile%\Documents\Files\" /D /E
/V /F /R /Y

XCOPY \\server\network\Strata\*.* "%userprofile%\Documents\Strata\" /D /E
/V /F /R /Y
 
A

Andrew McLaren

Jane is right. And I was off-track in my earlier reply (well, what I said
was correct technically; just totally useless for solving the problem!).



Jane C said:
"My Documents" does not exist in Vista. Try "Documents" instead:

Code:
XCOPY \\server\network\Files\*.* "%userprofile%\Documents\Files\" /D /E
/V /F /R /Y

XCOPY \\server\network\Strata\*.* "%userprofile%\Documents\Strata\" /D /E
/V /F /R /Y

--
Jane, not plain ;) 64 bit enabled :)
Batteries not included. Braincell on vacation ;-)
MVP - Windows Shell/User

Ashpoint said:
I have used the following .BAT file to update a two folders on my laptop.

Code:
XCOPY \\server\network\Files\*.* "%userprofile%\My Documents\Files\" /D
/E
/V /F /R /Y

XCOPY \\server\network\Strata\*.* "%userprofile%\My Documents\Strata\" /D
/E
/V /F /R /Y

The file worked for years when the OS was Windows XP Pro.

Now I have a Vista Business system, the process fails with permissions
issues.

Please advise where to look for a resolution

Thanks in advance:
 

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

Similar Threads


Top