Re: Script to Copy Files from a Share to a Client Not Working

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

From: Louis Lokuta (anonymous_at_discussions.microsoft.com)
Date: 10/13/04


Date: Wed, 13 Oct 2004 08:03:51 -0700

Paul,

Thanks again. I have the permissions applied now, so that
worked great. The script is in place and is executing as
well, but I'm still having a script error when the actual
copy attempts to take place.

I get two different messages: either permission denied
or path not found. Permission denied is bogus, because I
have the rights and if I copy the file from a disk or
flash drive to the local drive, it works fine.
Path not found is bogus too, because the path is there.

The copy is instructing the file located on a SERVER to
be copied to a client, but now I've noticed the WSH
script I found in the MSDN collection seems to only
indicate that it works for local file coping (not from
server).
Is this true?? How can I copy it from the network to the
client?

Here is my code:

Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
FSO.CopyFile "\\CALLISTO\VOL1\Public\make32vs.bat", "%
systemdrive%\Program Files\Masm"

Is there a problem in the share name? Server name? Syntax?
Should I be using UNC conventions to access the source
file on the server, or the mapped drive letter?

Louis

>-----Original Message-----
>No problem Louis!!!
>
>Navigate to:
>
>\GPO\Computer Configuration\ Windows Settings\ Security
Settings\ File
>System
>
>Right-click and choose Add file...
>
>In here, add the path to the folder that you want to set
the permissions on
>and then grant the permissions in the following dialog.
>
>
>
>* Note. If you can, use system variables, e.g. %
SYSTEMROOT%, etc.
>
>--
>
>Paul Williams
>
>http://www.msresource.net
>http://forums.msresource.net
>______________________________________
>"Louis Lokuta" <anonymous@discussions.microsoft.com>
wrote in message
>news:3dde01c4b011$d7679940$a401280a@phx.gbl...
>Paul,
>
>Thank you so much for the reply. I didn't know about the
>File System GPO attribute. Unfortunately, I'm not
familiar
>with it. Can you give me a quick run down on how to
>configure this folder permission?
>
>
>
>>-----Original Message-----
>>The script will run in user-context (that's using the
>credentials of the
>>user logging on) if it's a logon/logoff script.
>>
>>The script will run as SYSTEM if it's a startup/shutdown
>script.
>>
>>You'll need a logon script, so will need to either copy
>the file elsewhere
>>(probably not suitable for your solution) or set the
>permissions on the
>>folder that you wish to write this file to. If you
>require the latter, use
>>the File System section of a GPO to set the appropriate
>permissions on that
>>folder.
>>
>>--
>>
>>Paul Williams
>>
>>http://www.msresource.net
>>http://forums.msresource.net
>>______________________________________
>><anonymous@discussions.microsoft.com> wrote in message
>>news:2af701c4ad43$c0fe6c90$a601280a@phx.gbl...
>>Hello,
>>
>>I'm attempting to write a VB login script for
>>distribution in a GPO to take a file off of a shared
>>network drive, and copy it to a directory on the client.
>>
>>I'm using the following code that I found in the MSDN
>>collection:
>>
>>Dim FSO
>>Set FSO = CreateObject("Scripting.FileSystemObject")
>>FSO.CopyFile "K:\Public\make32vs.bat", "c:\Program
>>Files\Masm"
>>
>>When the script runs, I get an error on line #3, the
part
>>where the copy starts. It says 'permission denied'. The
>>script is setup to run when a user (who is a member of
>>the Users) group logs in. They do not have write
>>permission to the C:\Program Files folder, so I'm
>>assuming this is the cause of the problem. However, I
was
>>told that when scripts are distributed in a GPO, that
the
>>run under the "SYSTEM" account which has full
permissions
>>to everything. Is this wrong? How can I make this script
>>work?
>>
>>Also, the file that is being copied already exists on
the
>>local machine; I want to overwrite it. Will it get
>>overwritten when the copy takes place, or do I have to
>>put in another line in the code to take care of that?
>>
>>Please help!!!
>>Thanks in Advance,
>>Louis
>>
>>
>>.
>>
>
>
>.
>



Relevant Pages

  • IIS & ASP security advice
    ... I have a user who has requested special permissions on my IIS 5.0 server. ... that they do but IIS does not allow this to happen unless an ASP script is ...
    (microsoft.public.inetserver.iis.security)
  • Re: Local authentication errors on Windows 2003 Server
    ... Is this server a domain controller?? ... permissions to the share or access this computer from the network user ... The support tool gpresult or whoami will show group membership. ... Unable to open the GPO due to access denied. ...
    (microsoft.public.windows.server.security)
  • Re: using a general browser as a form-based capture method
    ... You are saying we find a simple web server which gets messages ... permissions ... possible to write to the local file system without modifying the user's ... either saved to a local file, or script support will be ...
    (comp.lang.javascript)
  • RE: [PHP] mkdir permission errors
    ... you're running the above script as root. ... Then if you run the same script via the web server, ... and permissions. ... understanding of those if you're going to administer the server. ...
    (php.general)
  • RE: VBS Script Execution Fails with Permission Denied
    ... Sounds though there might be a permissions issue on or around the FSO ... adding these user/groups to the ACLs for the resource etc. Try using Filemon ... question and get them to monitor reg/file access while running the script. ... > Server Specs ...
    (microsoft.public.scripting.vbscript)