Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Re: Xcopy not working in startup script

Reply
Thread Tools Display Modes

Re: Xcopy not working in startup script

 
 
Richard Mueller [MVP]
Guest
Posts: n/a

 
      10-04-2007
Slingshotz wrote:

> This is driving me nuts and I have not been able to find any answers
> on any user group. This is a basic batch file script that I am
> deploying through group policy in the startup script to copy
> templates
> from the server to the local machine. I'm deploying it during the
> startup so that every computer gets it, regardless of who logs in.
>
> =========================
> if NOT exist "C:\Templates" md "C:\Templates"
> pushd "\\servername\Templates\"
> xcopy *.dot C:\Templates /Y /D
> popd
> =========================
>
>
> The script works perfectly when run by itself, but during the startup
> script when a computer starts up it keeps saying that *.dot is not
> found.
>
>
> =========================
> File not found - *.dot
> 0 File(s) copied
> =========================
>
>
> When I replace the xcopy with a regular copy command, it works during
> startup but I need to only copy the files when there are newer
> templates on the server and thus have to use xcopy.
>
>
> I have confirmed that the computer has permisisons to copy from the
> server share (it obviously works as the copy command works). I have
> also tried it without the pushd commands to no avail, i.e.
>
>
> =========================
> if NOT exist "C:\Templates" md "C:\Templates"
> xcopy \\servername\Templates\*.dot C:\Templates /Y /D
> =========================
>
>
> The error message is the same, it says file not found. And I have
> confirmed that xcopy is working on the target machine. Like I said,
> it works fine on it's own, but when deployed through group policy it
> won't copy the files (but it makes the folder ok).
>
>
> Any suggestions would be greatly appreciated as I've burnt many hours
> trying to figure out this silly little problem.
>


I am not familiar with pushd and I cannot explain why copy would work when
xcopy does not. However, it is common for scripts to work when you run them
but not as a Startup script. When a Startup script runs there is no user.
Startup scripts run with System privileges on the local computer, but with
the permissions of the computer object elsewhere in the domain. The most
likely cause is that the computer object (computer domain account) lacks
permissions in the share. If all computers need permissions, you can grant
the permissions to the domain group "Domain Computers".

--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Xcopy not working in startup script Chris M Windows Server 0 10-04-2007 12:11 AM
Startup script Dan Windows Server 1 05-18-2007 11:06 PM
Windows Script Control (msscript.ocx) not working in 64 bit!? LeFourge Windows 64 Bit 2 03-03-2006 02:03 PM
RE: Computer startup script runs at for first time at shutdown Andrea Casini Windows Server 0 06-17-2005 08:54 AM
Startup script issue ninichr Windows Server 1 05-28-2005 03:17 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59