Re: Computer Startup Batch File via GPO (not working)

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



"Gar" <Gar@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:AD16BC48-AB70-4C1F-92EB-DE0E5C201C70@xxxxxxxxxxxxx
Hi,

I've just wrote a very short and simple batch files which copies some
files onto a set of computers on start up, this batch file is
assigned as a GPO to a Computer OU, via Startup script.

The batch file basically has the following command and I can confirm
that it executes fine under the context of a user.

IF EXIST C:\Folder1 COPY \\DOMAIN_PC1\Folder\File1 C:\Folder1

The GPO is copied to the Domains\SysVol\Domains\Policies\ folder on
the DC The source files to be copied are located under DOMAIN_PC1

Both of the above has been permissioned with full access to both
Authenticated Users and also to Domain Computers, as I believe Start
Up scripts are executed under the context of a computer account.

However, the copy job fails on boot up, and nothing in the event log
indicates what is going wrong. I've left it long enough for full
replication to take place across the DCs.

Any ideas guys?

I -think- you may have a minor flaw but I'm not positive. It fails here
too, on XP SP3+, P4.

Here are my changes:
IF EXIST C:\Folder1 : change to IF EXIST C:\folder1\ . Currently it
seems to be looking for the FILE Folder1, not the directory.
Then I added 2 sets of quotes:
IF EXIST "C:\Folder1\" COPY " \\DOMAIN_PC1\Folder\File1 C:\Folder1"

NOTE: Apologies, but: This is air code from memory: I am no longer at
the machine that used domains so I can't provide a screen shot. And of
course I was only copying one small file I created with copy con &
CTRL-Z.

Also, I don't think the Event Viewer will show you errors from the
Command Prompt, will it? I'd just remove any @ echo OFF you might have,
and watch the screen for errors. Makes the screen a little messy, but
it will put the error code right after the failing command in the batch.

If you still have troubles, I'd check in at alt.msdos.batch.nt
newsgroup and ask about it there. You'll get expert answers there from
professionals either in or formerly in the DOS field. Yes, DOS is quite
alive in many circles. Be sure you're polite; they're a bit picky about
interpersonal skills, but the information is top notch and they're not
afraid to say they don't know although that very seldom happens<g>.

HTH,

Twayne`





.



Relevant Pages

  • prnmngr.vbs file, default printers and SMS
    ... It runs perfectly thru a batch file I created - but ONLY ... push out that command line or batch file via SMS to these computers. ...
    (microsoft.public.scripting.wsh)
  • Re: net use help
    ... network printer, what happens is that on some computers, sometimes, the ... Allso is there a way to put the net use command into a bat file so it runs ... You then need to run this batch file until it fails. ...
    (microsoft.public.windowsxp.general)
  • Re: Startup Script
    ... How should I write this batch file? ... with /quiet being an argument for silent installation. ... First I urge you to put some logging information in your script too. ... see what's going on on the computers you are managing. ...
    (microsoft.public.windows.group_policy)
  • Re: What are my programmers asking me to do with my AD?
    ... The call command IS the changes and i just need to get it to run on the ... The most obvious solution is a startup script (batch file) with the call ... Then you can tell which computers got the fix. ... You can create a group with the computers that need the fix. ...
    (microsoft.public.windows.server.active_directory)
  • Re: Computer Startup Batch File via GPO (not working)
    ... but the example script was just to illustrate the line ... files onto a set of computers on start up, this batch file is ... Authenticated Users and also to Domain Computers, ... Command Prompt, will it? ...
    (microsoft.public.windows.group_policy)