Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Startup script to copy files to System32 folder 2

Status
Not open for further replies.

JPJeffery

Technical User
May 26, 2006
600
GB
I want to be able to copy files to all the PCs in our network/2003 domain.

My approach is hardly revolutionary:

1.Create .bat file to (among other things) test for existence of screensaver.scr in and copy it across if absent
2.Test the .bat works
3.Create Computer Startup Script GPO to run the .bat file

But the copy doesn't work in that context...

I added an output redirect to the line to see what happened:

Code:
echo copy %Screensaver% c:\windows\system32>>%SystemDrive%\config.txt
copy %Screensaver% c:\windows\system32 >>%SystemDrive%\config.txt

Which gives me:

Code:
copy \\srv01\softdist$\Screensaver\Screensaver.scr c:\windows\system32
  0 file(s) copied.

That at least proves the variables are working.

If I then run the script manually, i.e. using the admin account logged on the windows on the same PC (actually PCs), the screensaver gets copied, which proves the paths the variables refer to exist.

Incidentally, there's another part of the script which copies sleep.exe to system32 and that also fails when run as a Startup script but not when run manually.

Why the H won't files copy to the system32 folder when running under the SYSTEM account at startup time? Other file copies in the script work from the same central location, albeit to the All-Users Desktop, rather than windows\system32.

The PCs are Windows XP SP3.

I'm finding this really puzzling and frustrating. We're having a black building test this weekend so I was aiming to take advantage of all the PCs being off to get the new screensaver deployed when they all get switched back on.

Wish we had Server 2008 DCs so I could use GPO Preferences instead...

I have tried uninstalling anti-virus on one of the PCs but that's not made a difference.

JJ
[small][purple]Variables won't. Constants aren't[/purple]
There is no apostrophe in the plural of PC (or PST, or CPU, or HDD, or FDD, or photo, or breakfast...and so on)[/small]
 
Hi,
Could thios fact:
manually, i.e. using the admin account logged on the windows on the same PC
mean that the script needs to be run as the admin ( if that is possible)?



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Perhaps yes, but if it's running as a Startup script then it's running as SYSTEM which surely is much the same thing. Afterr all, that's the point of Startup scripts in contrast to Logon scripts (which run under the context of the current user).


JJ
[small][purple]Variables won't. Constants aren't[/purple]
There is no apostrophe in the plural of PC (or PST, or CPU, or HDD, or FDD, or photo, or breakfast...and so on)[/small]
 
then ask yourself this:

Does PCx SYSTEM have READ PERMISSION on the \\srv01\softdist$\Screensaver\ share?


if you are unsure, and this is only for a test, create a separate share and give EVERYONE access, then change the script to reflect that share as the %Screensaver% variable, and test again with it as the startup script...



Ben
"If it works don't fix it! If it doesn't use a sledgehammer..."
How to ask a question, when posting them to a professional forum.
Only ask questions with yes/no answers if you want "yes" or "no"
 
Had already considered that but (as per my OP) other files from the same location copy OK. The security is set identically to the Screensaver as it is on the other source sub-folders.

JJ
[small][purple]Variables won't. Constants aren't[/purple]
There is no apostrophe in the plural of PC (or PST, or CPU, or HDD, or FDD, or photo, or breakfast...and so on)[/small]
 
It's worth a shot.
:)

JJ
[small][purple]Variables won't. Constants aren't[/purple]
There is no apostrophe in the plural of PC (or PST, or CPU, or HDD, or FDD, or photo, or breakfast...and so on)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top