Help with FileSystemObject.CopyFile

Author Message
DexterRivera

  • Total Posts : 26
  • Scores: 1
  • Reward points : 10590
  • Joined: 10/30/2008
  • Status: offline
Help with FileSystemObject.CopyFile Monday, April 16, 2012 6:40 PM (permalink)
0
Hello,
 
I was wondering if someone could help me with a something I am trying to do.  I am prompting user for the hostname/IP of a machine then want to copy a file to a directory on that machine.  Below is what I have below so far.  It echos the input fine what is failing for me is trying to copying to the destination.  Any suggestions/help will be greatly appreciated.  Thanks in advance.
 
Hostname = Inputbox("Enter the hostname/IP of the target machine")
If Hostname = "" Then
  Do While Hostname = ""
    Hostname = Inputbox("Enter the hostname/IP of the target machine")
  Loop
End If
'Wscript.Echo (Hostname)
strPath = (Hostname)"\C$\Windows\System32\"
oFSO.CopyFile oEnv("windir") &"\System32\test.txt", strPath,True
 
#1
    DexterRivera

    • Total Posts : 26
    • Scores: 1
    • Reward points : 10590
    • Joined: 10/30/2008
    • Status: offline
    Re:Help with FileSystemObject.CopyFile Monday, April 16, 2012 6:51 PM (permalink)
    0
    Disregard,
     
    co-worker got me past this one.
     
    strPath = "\\" & Hostname & "\C$\Windows\System32\"
     
    #2
      skynrain

      • Total Posts : 7
      • Scores: 0
      • Reward points : 100
      • Joined: 5/10/2012
      • Status: offline
      Re:Help with FileSystemObject.CopyFile Thursday, May 10, 2012 10:34 AM (permalink)
      0
      It’s going to keep me busy for a while. 
       
       
      #3
        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-2013 ASPPlayground.NET Forum Version 3.9