Jump to content

.SubFolders

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
22 replies to this topic

#1
Spencer Elliott

Spencer Elliott

    Newbie

  • Members
  • PipPip
  • 24 posts
Hi there, I am new to VSscripting, this is my first attempt at writing something. I have experiance with C++, but find this rather different.

I need to write a script that deletes all files, and files within sub folders of a defined specific path that have not been accessed or modified with 7 days.
It also has to have some logging around it for audit trails...
I have written most of it, but I am stuck on how to make it loop through the sub folders (not just sub folders, but all sub folders within sub folders within sub folders etc etc etc) and delete there files too. At the moment it is just deleting the files within the folder that I have defined.
I also need a way to define a few folders in the target folder that should not have it, or it's contents deleted.


Here is my code so far:


' Printroom VBscript to delete files in a particular directory after seven days

' Only deletes files that have not been modified and accessed in seven days






''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

''''''''''''''''''''''''''' Settings for configuration '''''''''''''''''''''''''''''''''''''

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''


' This setting defines where the log file is placed.

Wheretoplacelogfile = "Z:\Templates For DVD's, CD's and Tabs\Name Plate templates\"

' This setting defines how many days the file needs to of been un-modified and not accessed before deletion

NumberOfDays = -7

' This setting defines what folder needs to be cleaned up

FolderForCleaning = "Z:\Templates For DVD's, CD's and Tabs\Name Plate templates\"


dim FoldersToNotDelete (1)


FoldersToNotDelete (0) = "Name Plate templates"

'FoldersToNotDelete (1) =

'FoldersToNotDelete (2) =

'FoldersToNotDelete (3) =

'FoldersToNotDelete (4) =

'FoldersToNotDelete (5) =

'FoldersToNotDelete (6) =



''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'''''''''''''''''''''''''' End of settings '''''''''''''''''''''''''''''''''''''''''''''''''

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''


LocalDate = Day(Now()) & "-" & Month(Now()) & "-" & Year(Now())

LocalTime = right("00" & Hour(NOW()), 2) & ":" & right("00" & Minute(NOW()), 2) & ":" & right("00" & Second(NOW()), 2)

Dim objNetwork

Set objNetwork = CreateObject("WScript.Network")

Wheretoplacelogfile = Wheretoplacelogfile & "Printroom Deletion Log File created by " & objNetwork.UserName & " " & LocalDate & ".txt"

Set fso = CreateObject("Scripting.FileSystemObject")

Set FileWriter = fso.CreateTextFile(Wheretoplacelogfile , True)

FileWriter.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")

FileWriter.WriteLine("Printroom clean-up code log file")

FileWriter.WriteLine("Generated on the " & LocalDate & " at " & LocalTime)

FileWriter.WriteLine("Log file generated by " & objNetwork.UserName & " using computer name " & objNetwork.ComputerName & " on the " & objNetwork.UserDomain & " domain" )

FileWriter.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")

FileWriter.WriteLine(" ")

FileWriter.WriteLine(" ")

FileWriter.WriteLine(" ")



Dim oFSO, oFolder, oFiles, oFile

Set oFSO = CreateObject("Scripting.FileSystemObject")

Set oFolder = oFSO.GetFolder(FolderForCleaning)

Set oFiles = oFolder.Files

FileWriter.WriteLine("######################################################################################")

FileWriter.WriteLine("Deleting contents of folder: " & oFolder.Name) 

FileWriter.WriteLine("######################################################################################")

for each oFile in oFiles

On Error Resume Next

FileWriter.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")

   FileWriter.WriteLine("File: " & oFile.Name)  

   FileWriter.WriteLine("File located: " & oFile.Path)  

   FileWriter.WriteLine("The file size is: " & oFile.Size & "Bytes" & "  and is a " & oFile.Type) 

   FileWriter.WriteLine("Last modified: " & oFile.DateLastModified)

   FileWriter.WriteLine("Last Accessed: " & oFile.DateLastAccessed)

   if (oFile.DateLastModified < DateAdd("d", NumberOfDays, Now()) and oFile.DateLastAccessed < DateAdd("d", NumberOfDays, Now())) then

   FileWriter.WriteLine("File confirmed for deletion...") 

   FileWriter.WriteLine("Deleting file...") 

   oFile.Delete True

   FileWriter.WriteLine("The file has now been deleted ")

   else

   FileWriter.WriteLine("File has been accessed or modified recently and is therefore active...") 

   FileWriter.WriteLine("Skipping deletion")

   end if

FileWriter.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")   

next

next



' Probably never going to happen, but best to just check the data again incase it took longer then a day, lol...

LocalDate = Day(Now()) & "-" & Month(Now()) & "-" & Year(Now())

LocalTime = right("00" & Hour(NOW()), 2) & ":" & right("00" & Minute(NOW()), 2) & ":" & right("00" & Second(NOW()), 2)

FileWriter.WriteLine(" ")

FileWriter.WriteLine(" ")

FileWriter.WriteLine(" ")

FileWriter.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")

FileWriter.WriteLine("Completed on the " & LocalDate & " at " & LocalTime)

FileWriter.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")

FileWriter.Close


Do you think you could help me? This is my first attempt at VB script and appreciate any help.

#2
Vswe

Vswe

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 9,552 posts
Please write the first part too. I don't know which type all variables are.

#3
Vswe

Vswe

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 9,552 posts
I created a replacement for this part:

        Dim oFSO, oFolder, oFiles, oFile

        oFSO = CreateObject("Scripting.FileSystemObject")

        oFolder = oFSO.GetFolder(FolderForCleaning)

        oFiles = oFolder.Files

        FileWriter.WriteLine("######################################################################################")

        FileWriter.WriteLine("Deleting contents of folder: " & oFolder.Name)

        FileWriter.WriteLine("######################################################################################")

        For Each oFile In oFiles

            On Error Resume Next

            FileWriter.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")

            FileWriter.WriteLine("File: " & oFile.Name)

            FileWriter.WriteLine("File located: " & oFile.Path)

            FileWriter.WriteLine("The file size is: " & oFile.Size & "Bytes" & "  and is a " & oFile.Type)

            FileWriter.WriteLine("Last modified: " & oFile.DateLastModified)

            FileWriter.WriteLine("Last Accessed: " & oFile.DateLastAccessed)

            If (oFile.DateLastModified < DateAdd("d", NumberOfDays, Now()) And oFile.DateLastAccessed < DateAdd("d", NumberOfDays, Now())) Then

                FileWriter.WriteLine("File confirmed for deletion...")

                FileWriter.WriteLine("Deleting file...")

                oFile.Delete(True)

                FileWriter.WriteLine("The file has now been deleted ")

            Else

                FileWriter.WriteLine("File has been accessed or modified recently and is therefore active...")

                FileWriter.WriteLine("Skipping deletion")

            End If

            FileWriter.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")

        Next


It looks like this:


        Dim Queue As String = FolderForCleaning & ";"


        While Queue <> ""

            Dim Path As String = Queue.Split(";")(0)

            Queue = Queue.Remove(0, Path.Length + 1)



            Dim oFolder As New System.IO.DirectoryInfo(Path)


            FileWriter.WriteLine("######################################################################################")

            FileWriter.WriteLine("Deleting contents of folder: " & oFolder.Name)

            FileWriter.WriteLine("######################################################################################")


            For Each oSubFolder In oFolder.GetDirectories

                Queue &= oSubFolder.FullName & ";"

            Next


            For Each oFile In oFolder.GetFiles



                On Error Resume Next

                FileWriter.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")

                FileWriter.WriteLine("File: " & oFile.Name)

                FileWriter.WriteLine("File located: " & oFile.Directory.FullName)

                FileWriter.WriteLine("The file size is: " & oFile.Length & " Bytes" & "  and is a " & oFile.Extension & " file")

                FileWriter.WriteLine("Last modified: " & oFile.LastWriteTime)

                FileWriter.WriteLine("Last Accessed: " & oFile.LastAccessTime)

                If (oFile.LastWriteTime < DateAdd("d", NumberOfDays, Now()) And oFile.LastAccessTime < DateAdd("d", NumberOfDays, Now())) Then

                    FileWriter.WriteLine("File confirmed for deletion...")

                    FileWriter.WriteLine("Deleting file...")

                    oFile.Delete()

                    FileWriter.WriteLine("The file has now been deleted ")

                Else

                    FileWriter.WriteLine("File has been accessed or modified recently and is therefore active...")

                    FileWriter.WriteLine("Skipping deletion")

                End If

                FileWriter.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")

            Next



        End While

Here it will list all directories it found in a queue and then go through them too.

#4
Spencer Elliott

Spencer Elliott

    Newbie

  • Members
  • PipPip
  • 24 posts
Thankyou very much for your help. I can see what you're doing and it has helped me better to understand.
I wish this language was close to c++, I would of prefered to make it a function, then call the function within itself. But I see how your code works. Thanks for your time.

There is a problem though, when I try to run the script it give an error on line 44, saying "unexpected end of statement". Line 44 for me is the line where you're declaring the queue type variable, here:

Dim Queue As String = FolderForCleaning & ";"

I have revised a few small parts of the code to suit me. Just so you know what my work in progress looks like. I am pretty sure now I can do the part where it doesn't delete specific folders or there contents afer some research.



' VBscript to delete files in a particular directory after seven days

' Only deletes files that have not been modified and accessed in seven days






''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

''''''''''''''''''''''''''' Settings for configuration '''''''''''''''''''''''''''''''''''''

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''


' This setting defines where the log file is placed.

Wheretoplacelogfile = "Z:\Templates For DVD's, CD's and Tabs\Name Plate templates\"

' This setting defines how many days the file needs to of been un-modified and not accessed before deletion

NumberOfDays = -7

' This setting defines what folder needs to be cleaned up

FolderForCleaning = "Z:\Templates For DVD's, CD's and Tabs\Name Plate templates\"



''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'''''''''''''''''''''''''' End of settings '''''''''''''''''''''''''''''''''''''''''''''''''

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''


LocalDate = Day(Now()) & "-" & Month(Now()) & "-" & Year(Now())

LocalTime = right("00" & Hour(NOW()), 2) & ":" & right("00" & Minute(NOW()), 2) & ":" & right("00" & Second(NOW()), 2)

Dim objNetwork

Set objNetwork = CreateObject("WScript.Network")

Wheretoplacelogfile = Wheretoplacelogfile & "Printroom Deletion Log File created by " & objNetwork.UserName & " " & LocalDate & ".txt"

Set fso = CreateObject("Scripting.FileSystemObject")

Set FileWriter = fso.CreateTextFile(Wheretoplacelogfile , True)

FileWriter.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")

FileWriter.WriteLine("Printroom clean-up code log file")

FileWriter.WriteLine("Generated on the " & LocalDate & " at " & LocalTime)

FileWriter.WriteLine("Log file generated by " & objNetwork.UserName & " using computer name " & objNetwork.ComputerName & " on the " & objNetwork.UserDomain & " domain" )

FileWriter.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")

FileWriter.WriteLine(" ")

FileWriter.WriteLine(" ")

FileWriter.WriteLine(" ")

FileWriter.WriteLine(" ")

FileWriter.WriteLine(" ")



Dim Queue As String = FolderForCleaning & ";"


        While Queue <> ""

            Dim Path As String = Queue.Split(";")(0)

            Queue = Queue.Remove(0, Path.Length + 1)



            Dim oFolder As New System.IO.DirectoryInfo(Path)


            For Each oSubFolder In oFolder.GetDirectories

                Queue &= oSubFolder.FullName & ";"

            Next


            For Each oFile In oFolder.GetFiles


                On Error Resume Next

               ' If (oFile.LastWriteTime < DateAdd("d", NumberOfDays, Now()) And oFile.LastAccessTime < DateAdd("d", NumberOfDays, Now())) Then

                FileWriter.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")

                FileWriter.WriteLine("File: " & oFile.Name)

                FileWriter.WriteLine("File located: " & oFile.Directory.FullName)

                FileWriter.WriteLine("The file size is: " & oFile.Length & " Bytes" & "  and is a " & oFile.Extension & " file")

                FileWriter.WriteLine("Last modified: " & oFile.LastWriteTime)

                FileWriter.WriteLine("Last Accessed: " & oFile.LastAccessTime)

                FileWriter.WriteLine("File confirmed for deletion...")

                FileWriter.WriteLine("Deleting file...")

               ' oFile.Delete()

                FileWriter.WriteLine("The file has now been deleted ")

               ' End If

          

            Next


        End While






' Probably never going to happen, but best to just check the data again incase it took longer then a day, lol...

LocalDate = Day(Now()) & "-" & Month(Now()) & "-" & Year(Now())

LocalTime = right("00" & Hour(NOW()), 2) & ":" & right("00" & Minute(NOW()), 2) & ":" & right("00" & Second(NOW()), 2)

FileWriter.WriteLine(" ")

FileWriter.WriteLine(" ")

FileWriter.WriteLine(" ")

FileWriter.WriteLine(" ")

FileWriter.WriteLine(" ")

FileWriter.WriteLine(" ")

FileWriter.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")

FileWriter.WriteLine("Completed on the " & LocalDate & " at " & LocalTime)

FileWriter.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")

FileWriter.Close



#5
Vswe

Vswe

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 9,552 posts
You can of course call a function from itself but I prefer to make a queue since it can't call itself too many time, It will result in an Error.

#6
Spencer Elliott

Spencer Elliott

    Newbie

  • Members
  • PipPip
  • 24 posts

Vswe said:

You can of course call a function from itself but I prefer to make a queue since it can't call itself too many time, It will result in an Error.


I see, thankyou.

Also, what about this error "Unexpected end of statement" on this line:

Dim Queue As String = FolderForCleaning & ";"


I also have it now emailing me the file! :-)

#7
Vswe

Vswe

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 9,552 posts
Is that the only error message you got?

#8
Spencer Elliott

Spencer Elliott

    Newbie

  • Members
  • PipPip
  • 24 posts

Vswe said:

Is that the only error message you got?

I'm assuming that if and when that is fixed, it'll give another one, but the error message is as follows:

Quote

Windows Script Host
Line: 44
Char: 11
Error: Expectd end of statement
Code: 800a0401
Source: Microsoft VBScript compilation error


#9
Vswe

Vswe

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 9,552 posts
try this instead:

Dim Queue As String
Queue = FolderForCleaning & ";"


#10
Spencer Elliott

Spencer Elliott

    Newbie

  • Members
  • PipPip
  • 24 posts

Vswe said:

try this instead:

Dim Queue As String

Queue = FolderForCleaning & ";"

Tried, gave the same error as before, on line 44. Which is now "Dim queue As string"


' VBscript to delete files in a particular directory after seven days

' Only deletes files that have not been modified and accessed in seven days






''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

''''''''''''''''''''''''''' Settings for configuration '''''''''''''''''''''''''''''''''''''

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''


' This setting defines where the log file is placed.

Wheretoplacelogfile = "Z:\Templates For DVD's, CD's and Tabs\Name Plate templates\"

' This setting defines how many days the file needs to of been un-modified and not accessed before deletion

NumberOfDays = -7

' This setting defines what folder needs to be cleaned up

FolderForCleaning = "Z:\Templates For DVD's, CD's and Tabs\Name Plate templates\"



''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'''''''''''''''''''''''''' End of settings '''''''''''''''''''''''''''''''''''''''''''''''''

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''


LocalDate = Day(Now()) & "-" & Month(Now()) & "-" & Year(Now())

LocalTime = right("00" & Hour(NOW()), 2) & ":" & right("00" & Minute(NOW()), 2) & ":" & right("00" & Second(NOW()), 2)

Dim objNetwork

Set objNetwork = CreateObject("WScript.Network")

Wheretoplacelogfile = Wheretoplacelogfile & "Printroom Deletion Log File created by " & objNetwork.UserName & " " & LocalDate & ".txt"

Set fso = CreateObject("Scripting.FileSystemObject")

Set FileWriter = fso.CreateTextFile(Wheretoplacelogfile , True)

FileWriter.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")

FileWriter.WriteLine("Clean-up log file")

FileWriter.WriteLine("Generated on the " & LocalDate & " at " & LocalTime)

FileWriter.WriteLine("Log file generated by " & objNetwork.UserName & " using computer name " & objNetwork.ComputerName & " on the " & objNetwork.UserDomain & " domain" )

FileWriter.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")

FileWriter.WriteLine(" ")

FileWriter.WriteLine(" ")

FileWriter.WriteLine(" ")

FileWriter.WriteLine(" ")

FileWriter.WriteLine(" ")



Dim Queue As String

Queue = FolderForCleaning & ";"


        While Queue <> ""

            Dim Path As String = Queue.Split(";")(0)

            Queue = Queue.Remove(0, Path.Length + 1)



            Dim oFolder As New System.IO.DirectoryInfo(Path)


            For Each oSubFolder In oFolder.GetDirectories

                Queue &= oSubFolder.FullName & ";"

            Next


            For Each oFile In oFolder.GetFiles


                On Error Resume Next

               ' If (oFile.LastWriteTime < DateAdd("d", NumberOfDays, Now()) And oFile.LastAccessTime < DateAdd("d", NumberOfDays, Now())) Then

                FileWriter.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")

                FileWriter.WriteLine("File: " & oFile.Name)

                FileWriter.WriteLine("File located: " & oFile.Directory.FullName)

                FileWriter.WriteLine("The file size is: " & oFile.Length & " Bytes" & "  and is a " & oFile.Extension & " file")

                FileWriter.WriteLine("Last modified: " & oFile.LastWriteTime)

                FileWriter.WriteLine("Last Accessed: " & oFile.LastAccessTime)

                FileWriter.WriteLine("File confirmed for deletion...")

                FileWriter.WriteLine("Deleting file...")

               ' oFile.Delete()

                FileWriter.WriteLine("The file has now been deleted ")

               ' End If

          

            Next


        End While






' Probably never going to happen, but best to just check the data again incase it took longer then a day, lol...

LocalDate = Day(Now()) & "-" & Month(Now()) & "-" & Year(Now())

LocalTime = right("00" & Hour(NOW()), 2) & ":" & right("00" & Minute(NOW()), 2) & ":" & right("00" & Second(NOW()), 2)

FileWriter.WriteLine(" ")

FileWriter.WriteLine(" ")

FileWriter.WriteLine(" ")

FileWriter.WriteLine(" ")

FileWriter.WriteLine(" ")

FileWriter.WriteLine(" ")

FileWriter.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")

FileWriter.WriteLine("Completed on the " & LocalDate & " at " & LocalTime)

FileWriter.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")

FileWriter.Close



#11
Vswe

Vswe

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 9,552 posts
Don't declare what type it is then:

Dim Queue = FolderForCleaning & ";"

or

Dim Queue
Queue= FolderForCleaning & ";"


#12
Spencer Elliott

Spencer Elliott

    Newbie

  • Members
  • PipPip
  • 24 posts

Vswe said:

Don't declare what type it is then:

Dim Queue = FolderForCleaning & ";"

or

Dim Queue

Queue= FolderForCleaning & ";"



I appreciate all the help and time you're giving me, many thanks. This howeever, still gives the same error. :-(