Announcement

Collapse
No announcement yet.

Need help with script

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

    Need help with script

    As this script stands, it overwrites the file each time it is run. Does anyone know how I could change it so that it creates a different file name each time so that I can save all the files? Thanks.

    Set fso = CreateObject("Scripting.FileSystemObject")
    Set f1 = fso.CreateTextFile("c:\Program Files\Homeseer\html\Beach_Forecast\Beach_Forecast_from_Weath er-com.txt")
    f1.WriteLine Webpage
    f1.Close

    #2
    Beach,

    Here is one way you can do it:

    <pre class="ip-ubbcode-code-pre">
    Set fso = CreateObject("Scripting.FileSystemObject")
    path = "Program Files\Homeseer\html\Beach_Forecast\Beach_Forecast_from_Weath er-com " & Now() & ".txt"
    'replace the / from date portion of Now() with a -
    path = replace(path,"/","-")
    'get rid of the : from the time portion of Now()
    path = replace(path,":","")
    path = "c:\" & path
    Set f1 = fso.CreateTextFile(path)
    f1.WriteLine Webpage
    f1.Close
    </pre>
    This will append the date and time to the filename making it unique everytime.

    Hope this helps.

    Comment


      #3
      Thanks a lot joe. That worked great. Now if I could only get the vr on the movie script to work. I'm trying.

      Comment


        #4
        I'm glad that worked for you, Beach. Good luck with the vr. I wouldn't be of much help there since I don't use vr.

        Cheers,

        Comment

        Working...
        X