Convert VBScript statement to VB.Net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Luk3r
    Contributor
    • Jan 2014
    • 300

    #16
    This isn't normally the way I like to test things, but can you manually replace "CurrentPat h" with a valid directory and/or run the following code to make sure the CurrentPath is what you expect it to be?
    Code:
    MsgBox(ApplicationStartupPath)
    Just place that code in your button click event. It will show the absolute path that you are trying to write to.

    Comment

    • BHo15
      New Member
      • Feb 2014
      • 143

      #17
      Good thought. The application.Sta rtupPath is indeed what I was expecting. It is where the exe for the .net app lives, and where I have placed the vbscript and the Excel workbook.

      I even tried yesterday hardcoding that path into the command, so that it said... "Shell("cmd /c cscript //NoLogo " & CurrentPath & "TweakedFetch.v bs " & strUser & " " & strNet & " " & strBDate & " " & strEDate & " " & strPW & " > C:\Users\bhodge \Documents\Visu al Studio 2010\Projects\C all Fetch\Call Fetch\bin\Debug \DNLD.csv").

      No luck. :(

      Comment

      • Luk3r
        Contributor
        • Jan 2014
        • 300

        #18
        K, sort of what I was expecting. Notice your path has spaces? CMD prompt isn't too 'space' savvy. You need to double quote a few things. Try this line.

        Code:
        Shell("cmd /c cscript //NoLogo """ & currentPath & """TweakedFetch.vbs " & strUser & " " & strNet & " " & strBDate & " " & strEDate & " " & strPW & " >""" & currentPath & """DNLD.csv")

        Comment

        • BHo15
          New Member
          • Feb 2014
          • 143

          #19
          No go. :(

          Should we call it quits on this one, and instead start a new thread with converting the main vbscript? It is taking the values that we send with the shell command, and interacting with the OpenDNS website.

          I actually attempted a few days ago to convert it to .net, and got 99% of it "converted" without errors. I could post what I came up with for your review if you would like. But either way, we still have to eventually get the output from OpenDNS's website to a CSV.

          Comment

          • Luk3r
            Contributor
            • Jan 2014
            • 300

            #20
            I'm not a fan of "calling it quits", but I'm just not able to replicate the issue you're having. If you wish, open a new thread and post the VB.NET code you have and we'll iron it out :)

            Comment

            • BHo15
              New Member
              • Feb 2014
              • 143

              #21
              I don't blame you one bit on the avoidance of quitting. I just don't want to be one of the "users" who just doesn't seem to get it. :)

              I did go ahead and start a new thread (OpenDNS download automation - VBScript to VB.Net). Feel free to look at it now or later (your choice). I don't mind continuing on with this one at all.

              Comment

              Working...