Results 1 to 24 of 24

Thread: [RESOLVED] How to convert VBScript to VB.Net

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2010
    Posts
    272

    Resolved [RESOLVED] How to convert VBScript to VB.Net

    I am trying to convert a vbscript to VB.net. This is where I am currently, can someone help me convert this to vb.net?
    Code:
        Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
            Const FOF_CREATEPROGRESSDLG = &H0&
            Dim fName
            Dim objShell, objFolder As Object
            Dim TargetFolder As String
            Dim d As Date = Date.Today
            d = d.AddDays(-5)
            fName = Microsoft.VisualBasic.Right("00" & Month(d), 2) & "." & Microsoft.VisualBasic.Right("00" & Day(d), 2) & "." & Microsoft.VisualBasic.Right(Year(d), 2) & "_"
            TargetFolder = "N:\Daily Data\Production"
            objShell = CreateObject("Shell.Application")
            objFolder = objShell.NameSpace(TargetFolder)
            objFolder.MoveHere("Q:\Archive\\" & fName & "*", FOF_CREATEPROGRESSDLG)
        End Sub
    End Class
    The compile errors I get are:
    Day is a type and cannot be used in an expression
    Last edited by Jo15765; May 16th, 2013 at 07:40 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width