Startup script question

K

Kev

I need to run a script on some XP machines and I need to get some utilities
copied onto the machine to perform the task. I was going to copy the
necessary files from a network share but giving 'domain computers' read
access does not allow me to access the files.

My ORIGINAL plan was to copy the files from where the startup script
resides. However, using copy *.exe c:\temp causes the system to copy files
from (apparently) the c:\windows folder. Is there an environment variable
that I can use to refer to the path where the script is located ?

Or is there some other / better way to get these files copied down ?

Thanks
 
P

Pegasus \(MVP\)

Kev said:
I need to run a script on some XP machines and I need to get some utilities
copied onto the machine to perform the task. I was going to copy the
necessary files from a network share but giving 'domain computers' read
access does not allow me to access the files.

My ORIGINAL plan was to copy the files from where the startup script
resides. However, using copy *.exe c:\temp causes the system to copy files
from (apparently) the c:\windows folder. Is there an environment variable
that I can use to refer to the path where the script is located ?

Or is there some other / better way to get these files copied down ?

Thanks

When I type

copy /?

at the Command Prompt then I see this:

COPY [/D] [/V] [/N] [/Y | /-Y] [/Z] [/A | /B ] source [/A | /B]
[+ source [/A | /B] [+ ...]] [destination [/A | /B]]

Note how it says "source" and "destination"? You did not
specify a "destination" in your script, hence the files ended
up in the Windows directory. This won't happen if you
specify exactly where the files should go.
 
K

Kev

Pegasus (MVP) said:
Kev said:
I need to run a script on some XP machines and I need to get some utilities
copied onto the machine to perform the task. I was going to copy the
necessary files from a network share but giving 'domain computers' read
access does not allow me to access the files.

My ORIGINAL plan was to copy the files from where the startup script
resides. However, using copy *.exe c:\temp causes the system to copy files
from (apparently) the c:\windows folder. Is there an environment
variable
that I can use to refer to the path where the script is located ?

Or is there some other / better way to get these files copied down ?

Thanks

When I type

copy /?

at the Command Prompt then I see this:

COPY [/D] [/V] [/N] [/Y | /-Y] [/Z] [/A | /B ] source [/A | /B]
[+ source [/A | /B] [+ ...]] [destination [/A | /B]]

Note how it says "source" and "destination"? You did not
specify a "destination" in your script, hence the files ended
up in the Windows directory. This won't happen if you
specify exactly where the files should go.

Thanks. Maybe I did not make it clear. The files *come from* c:\windows
and end up where they should be. What I need to see is that the files on
the server (stored where the GPO script is) get copied down to c:\temp and
not those in c:\windows.
 
P

Pegasus \(MVP\)

Kev said:
Pegasus (MVP) said:
Kev said:
I need to run a script on some XP machines and I need to get some utilities
copied onto the machine to perform the task. I was going to copy the
necessary files from a network share but giving 'domain computers' read
access does not allow me to access the files.

My ORIGINAL plan was to copy the files from where the startup script
resides. However, using copy *.exe c:\temp causes the system to copy files
from (apparently) the c:\windows folder. Is there an environment
variable
that I can use to refer to the path where the script is located ?

Or is there some other / better way to get these files copied down ?

Thanks

When I type

copy /?

at the Command Prompt then I see this:

COPY [/D] [/V] [/N] [/Y | /-Y] [/Z] [/A | /B ] source [/A | /B]
[+ source [/A | /B] [+ ...]] [destination [/A | /B]]

Note how it says "source" and "destination"? You did not
specify a "destination" in your script, hence the files ended
up in the Windows directory. This won't happen if you
specify exactly where the files should go.

Thanks. Maybe I did not make it clear. The files *come from* c:\windows
and end up where they should be. What I need to see is that the files on
the server (stored where the GPO script is) get copied down to c:\temp and
not those in c:\windows.

In this case you must specify the correct **source** folder.
Try this:
copy \\YourServer\NetLogon\xxx.exe c:\SomeFolder

If this does not work then you should post your actual
script file.
 
K

Kev

In this case you must specify the correct **source** folder.
Try this:
copy \\YourServer\NetLogon\xxx.exe c:\SomeFolder

If this does not work then you should post your actual
script file.

Thanks. The problem is I don't know what 'some folder' should be. I know
that I could determine the GUID but that's hardly good scripting style.
What I need to know is, when the startup script is running, how do I refer
to the folder where the startup script is loaded.
 
P

Pegasus \(MVP\)

Kev said:
Thanks. The problem is I don't know what 'some folder' should be. I know
that I could determine the GUID but that's hardly good scripting style.
What I need to know is, when the startup script is running, how do I refer
to the folder where the startup script is loaded.

I gave you the answer. It's in the "netlogon" share.
 
K

Kev

Pegasus (MVP) said:
I gave you the answer. It's in the "netlogon" share.

The script on my test server is located at -
\\domain\SysVol\mat.co\Policies\{E9A7A2C5-FECD-47C3-B896-10A3C4F46368}\Machine\Scripts\Startup

I cannot access these network resources (including the netlogon share) while
not authenticated with the domain and I don't want to use NET USE to map a
drive using a shared account.

Thanks
 
P

Pegasus \(MVP\)

Kev said:
The script on my test server is located at -
\\domain\SysVol\mat.co\Policies\{E9A7A2C5-FECD-47C3-B896-10A3C4F46368}\Machi
ne\Scripts\Startup

I cannot access these network resources (including the netlogon share) while
not authenticated with the domain and I don't want to use NET USE to map a
drive using a shared account.

Thanks

You could test this script:

@echo off
echo the current script path + name is %0

If successful then you could extract the path from %0.

A more robust method would consist of creating a share
that is accessible to all users. At the point in time of executing
the logon script they are authenticated and can access domain
resources.
 
K

Kev

Pegasus (MVP) said:
You could test this script:

@echo off
echo the current script path + name is %0

If successful then you could extract the path from %0.

A more robust method would consist of creating a share
that is accessible to all users. At the point in time of executing
the logon script they are authenticated and can access domain
resources.
Thanks but this is a startup script so no user accounts are being
authenticated,]
 

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