File Copy

Author Message
cjwallace

  • Total Posts : 549
  • Scores: 0
  • Reward points : 0
  • Joined: 3/5/2005
  • Location: United Kingdom
  • Status: offline
File Copy Wednesday, March 09, 2005 2:32 AM (permalink)
0
Guys, i am trying to copy a file from a network share to a local drive.

I have in my script

Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.copyfile "\\zeus\zenapps\nav\grc.dat", "C:\Documents and Settings\All Users\Application Data\Symantec\Symantec AntiVirus Corporate Edition\7.5"

Can anyone tell me what is wrong with the above code as i cant get it to copy the grc.dat file

Cheers

Craig
 
#1
    mbouchard

    • Total Posts : 2110
    • Scores: 29
    • Reward points : 0
    • Joined: 5/15/2003
    • Location: USA
    • Status: offline
    Re: File Copy Wednesday, March 09, 2005 2:40 AM (permalink)
    0
    What error are you getting?
     
    #2
      cjwallace

      • Total Posts : 549
      • Scores: 0
      • Reward points : 0
      • Joined: 3/5/2005
      • Location: United Kingdom
      • Status: offline
      Re: File Copy Wednesday, March 09, 2005 3:04 AM (permalink)
      0
      Hi mbouchard, Im not getting an error its just not copying the file.

      Thanks for your help in advanced
       
      #3
        mbouchard

        • Total Posts : 2110
        • Scores: 29
        • Reward points : 0
        • Joined: 5/15/2003
        • Location: USA
        • Status: offline
        Re: File Copy Wednesday, March 09, 2005 3:12 AM (permalink)
        0
        By any chance is the dat file in use?
         
        #4
          cjwallace

          • Total Posts : 549
          • Scores: 0
          • Reward points : 0
          • Joined: 3/5/2005
          • Location: United Kingdom
          • Status: offline
          Re: File Copy Wednesday, March 09, 2005 3:45 AM (permalink)
          0
          Mbouchard: , Thanks for the reply. I dont think it is in use to be honest. I can copy it via a batch file ok

          So is the code i have ok? , Any other ideas as to why it is not working?

          Cheers
           
          #5
            mbouchard

            • Total Posts : 2110
            • Scores: 29
            • Reward points : 0
            • Joined: 5/15/2003
            • Location: USA
            • Status: offline
            Re: File Copy Wednesday, March 09, 2005 3:59 AM (permalink)
            0
            Without testing it, I think you need a trailing \ on the destination.

            objFSO.copyfile "\\zeus\zenapps\nav\grc.dat", "C:\Documents and Settings\All Users\Application Data\Symantec\Symantec AntiVirus Corporate Edition\7.5\"
             
            #6
              cjwallace

              • Total Posts : 549
              • Scores: 0
              • Reward points : 0
              • Joined: 3/5/2005
              • Location: United Kingdom
              • Status: offline
              Re: File Copy Wednesday, March 09, 2005 4:08 AM (permalink)
              0
              Mbouchard: , Top man that did the trick, not sure what was wrong because i did have the \ at one point but now it works

              Cheers for all your help
               
              #7

                Online Bookmarks Sharing: Share/Bookmark

                Jump to:

                Current active users

                There are 0 members and 1 guests.

                Icon Legend and Permission

                • New Messages
                • No New Messages
                • Hot Topic w/ New Messages
                • Hot Topic w/o New Messages
                • Locked w/ New Messages
                • Locked w/o New Messages
                • Read Message
                • Post New Thread
                • Reply to message
                • Post New Poll
                • Submit Vote
                • Post reward post
                • Delete my own posts
                • Delete my own threads
                • Rate post

                2000-2012 ASPPlayground.NET Forum Version 3.9