Announcement

Collapse
No announcement yet.

Simplest of scripts driving me crazy!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Simplest of scripts driving me crazy!

    Is there a problem with Scripting dealing with files on a Network Share? If I used either UNC or Mapped Drive, it can never see that the file exists or copy it.

    If you do the same with the local C Drive there is no issue. The below will report that the folder exists, but it can never see the file. (Yes it is in the folder)

    I first get the filename from the string of a Homeseer device (It is valid)

    SourceFile = hs.DeviceString (2665)
    DestFile = "\\192.168.1.99\folderB\file.txt"

    Set FSO = CreateObject("Scripting.FileSystemObject")

    if FSO.Folderexists("\\192.168.1.99\folderA") then
    hs.writeLogEx "Info", "Folder Exists", "#000080"
    end if

    If FSO.FileExists(SourceFile) Then
    hs.writeLogEx "Info", "File Exists", "#000080"
    FSO.CopyFile SourceFile, DestFile
    end if


    I simply want to copy a file which is on a network share using an event!! HELP.

    #2
    What is the form of the contents of SourceFile? Does it include the complete path? Are you changing directory to point to folderA?
    Mike____________________________________________________________ __________________
    HS3 Pro Edition 3.0.0.548, NUC i3

    HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

    Comment


      #3
      barto

      I believe the issue may be the way hs.writeLogEx is being used.

      Roger D

      Comment


        #4
        What user account is HS running under? And, is HS running as a service or just a stand alone app?
        Different user accounts will have different UNCs mapped. For example, if I log in as an administrator and map z: to \\myserver\foo it will work great for Administrator. But if I log in as Joe or a service is running as localsystem then it won't see a z: since it was mapped using a different user account.

        Comment

        Working...
        X