#29903 - 2002-09-30 12:40 AM
Copying files
|
Sverre
Getting the hang of it
Registered: 2002-09-29
Posts: 52
|
I am copying certain files from the netlogon share to the local users harddisk, all of them work just fine except this one:
$dir=ReadValue("HKEY_LOCAL_MACHINE\software\microsoft\windows NT\currentversion", "SystemRoot") Copy "%0\..\ls.bmp" $dir
What am I doing wrong here? All users have admin privileges on their local machine. If I run the script after the user is logged on it works fine.
|
Top
|
|
|
|
#29904 - 2002-09-29 02:37 PM
Re: Copying files
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
the basic troubleshooting steps that I would employ are:
1) print the command to verify it looks proper. Add something like ? 'Copy "%0\..\ls.bmp" $dir' before the copy command.
2) Add '? @error @serror" after the COPY command to determine why the coomand is failing.
|
Top
|
|
|
|
#29905 - 2002-09-29 02:50 PM
Re: Copying files
|
Sverre
Getting the hang of it
Registered: 2002-09-29
Posts: 52
|
The reply is: 2 The system can not find the file specified
I have even tried writing: copy ls.bmp c:\winnt and it gets the same error messages
The script is ok, it works with me (but I'm a member of the domain admins) and it also works for the users if the script is run AFTER they log on and have Windows up and running.
|
Top
|
|
|
|
#29906 - 2002-09-29 03:13 PM
Re: Copying files
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
What OS? XP has some issues with %0. When you print the copy command does it look properly formed? The error you specified, "2", would indicate to me a problem with the first paramter of the copy command, not the second.
|
Top
|
|
|
|
#29907 - 2002-09-29 03:22 PM
Re: Copying files
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
In your previous example you stated you tried "copy ls.bmp c:\winnt" what is the path for ls.bmp? Use quotes around each parameter.
|
Top
|
|
|
|
#29908 - 2002-09-29 03:26 PM
Re: Copying files
|
Sverre
Getting the hang of it
Registered: 2002-09-29
Posts: 52
|
The problem seems to be on any machines as long as the user don't have domain admin rights.
Other copy commands with %0/../ works just fine.
The ls.bmp resides in the netlogon directory.
I did not use quotes around the parameters: copy ls.bmp c:\winnt. But since it works when I log on as a domain admin I figure the problem isn't there, but rather something to do with the user rights. The authenticated users has read/write/execute rights to the netlogon directory and I even tried giving everyone full rights, but it didn't help.
|
Top
|
|
|
|
#29909 - 2002-09-29 03:32 PM
Re: Copying files
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
If the logon script can execute from the netlogon directory, then there should not be a permissions problem there. Error 2 indicates a path issue. Does the file have any specific permission or attributes? If the user lacked permissions, I would have expected an error 5 (Access Denied).
Change your copy command to copy to "%temp%" to avoid permission issues on the destination. Does that work?
|
Top
|
|
|
|
#29910 - 2002-09-29 03:55 PM
Re: Copying files
|
Sverre
Getting the hang of it
Registered: 2002-09-29
Posts: 52
|
Have tried copying to "c:\temp", nothing there (works for domain admins).
Tried giving everyone full control of the file, still nothing there.
As far as I can understand there has to be something in the way things work when they log on. Obviously the file isn't accessible to the user during the login, it is after the login has been done, but not until the explorer is up. The strange thing is that it's accessible to a domain admin during the login process both on an XP and a W2K machine.
|
Top
|
|
|
|
#29911 - 2002-09-29 04:05 PM
Re: Copying files
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
the user may not have access to c:\temp. On W2K and XP %temp% is not c:\temp.
|
Top
|
|
|
|
#29912 - 2002-09-29 04:07 PM
Re: Copying files
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Create a new text file and place it in the netlogon directory. Try to copy it to "%temp%" (Use the environment variable). Does that work?
|
Top
|
|
|
|
#29914 - 2002-09-29 05:01 PM
Re: Copying files
|
Sverre
Getting the hang of it
Registered: 2002-09-29
Posts: 52
|
Tried it with c:\winnt and it doesn't help.
Tried it with a text file "test.txt" and it doesn't work.
I copy some files from the same location a couple of rows above where this is and it works (to a different directory).
Tried to put the file in another folder under netlogon and it doesn't work.
I'm completely out of ideas.
|
Top
|
|
|
|
#29916 - 2002-09-29 05:12 PM
Re: Copying files
|
Sverre
Getting the hang of it
Registered: 2002-09-29
Posts: 52
|
Tried to post the script but it only complains about HTML tags, I REALLY hate that!
|
Top
|
|
|
|
#29917 - 2002-09-29 05:14 PM
Re: Copying files
|
Sverre
Getting the hang of it
Registered: 2002-09-29
Posts: 52
|
It works well other places in the script? And I get the same problem if I don't use %0\.., so I expect it is something else.
|
Top
|
|
|
|
#29922 - 2002-09-29 05:28 PM
Re: Copying files
|
Sverre
Getting the hang of it
Registered: 2002-09-29
Posts: 52
|
Source file is
n:\ls.bmp Everyone:F Everyone:R NT AUTHORITY\Authenticated Users:R R BUILTIN\Administrators:F NT AUTHORITY\SYSTEM:F
Source path is
n:\ Everyone:(OI)(CI)R NT AUTHORITY\Authenticated Users:R NT AUTHORITY\Authenticated Users:(OI)(CI)(IO)(special access:) GENERIC_READ GENERIC_EXECUTE
R (OI)(CI)(IO)(special access:) GENERIC_READ GENERIC_EXECUTE
BUILTIN\Administrators:F BUILTIN\Administrators:(OI)(CI)(IO)F NT AUTHORITY\SYSTEM:F NT AUTHORITY\SYSTEM:(OI)(CI)(IO)F CREATOR OWNER:(OI)(CI)(IO)F
Target path is (they have admin rights on local PC)
c:\WINDOWS BUILTIN\Users:R BUILTIN\Users:(OI)(CI)(IO)(special access:) GENERIC_READ GENERIC_EXECUTE
BUILTIN\Power Users:C BUILTIN\Power Users:(OI)(CI)(IO)C BUILTIN\Administrators:F BUILTIN\Administrators:(OI)(CI)(IO)F NT AUTHORITY\SYSTEM:F NT AUTHORITY\SYSTEM:(OI)(CI)(IO)F BUILTIN\Administrators:F CREATOR OWNER:(OI)(CI)(IO)F
Target file doesn't exist.
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Allen)
and 466 anonymous users online.
|
|
|