Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Parse Quotation marks

Parse Quotation marks

Scheduled Pinned Locked Moved Visual Basic
linuxtoolshelp
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rip V Winkle
    wrote on last edited by
    #1

    I am trying to parse the quotation marks from a string that is returned from an inputbox and then "shell" to the console. Here is my code. Dim FileName As String = InputBox("Please enter the file name here") Shell("c:\program files\d-tools\daemon.exe" & " -unmount 0 ") Shell("c:\program files\d-tools\daemon.exe" & " -mount 0," & FileName) End Sub Just to clarify this is a console app. Any help would be great! Thank I'm just a simple man with complex issues.

    D 1 Reply Last reply
    0
    • R Rip V Winkle

      I am trying to parse the quotation marks from a string that is returned from an inputbox and then "shell" to the console. Here is my code. Dim FileName As String = InputBox("Please enter the file name here") Shell("c:\program files\d-tools\daemon.exe" & " -unmount 0 ") Shell("c:\program files\d-tools\daemon.exe" & " -mount 0," & FileName) End Sub Just to clarify this is a console app. Any help would be great! Thank I'm just a simple man with complex issues.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      I'm not sure what your looking for. What do you mean by parse? What is the end result supposed to look like? _Dim FileName As String = InputBox("Please enter the file name here") Shell("c:\program files\d-tools\daemon.exe" & " -unmount 0 ") Shell("c:\program files\d-tools\daemon.exe" & " -mount 0," & FileName)_ The InputBox looks OK. If the user types (WITH quotes): "C:\Program Files\Stuff.txt", that exact string will be passed in the Shell statement. The 2nd shell command will look exactly like this: c:\program files\d-tools\daemon.exe -mount 0,"C:\Program Files\Stuff.txt" If that's what you want passed to the Shell, then you don't have any problems... BTW: What's with the '&' your using right after the daemon.exe? You don't need it there. Just to make the code a little more readable, you might want to take those out, but keep the one in front of 'FileName'. RageInTheMachine9532

      R 1 Reply Last reply
      0
      • D Dave Kreskowiak

        I'm not sure what your looking for. What do you mean by parse? What is the end result supposed to look like? _Dim FileName As String = InputBox("Please enter the file name here") Shell("c:\program files\d-tools\daemon.exe" & " -unmount 0 ") Shell("c:\program files\d-tools\daemon.exe" & " -mount 0," & FileName)_ The InputBox looks OK. If the user types (WITH quotes): "C:\Program Files\Stuff.txt", that exact string will be passed in the Shell statement. The 2nd shell command will look exactly like this: c:\program files\d-tools\daemon.exe -mount 0,"C:\Program Files\Stuff.txt" If that's what you want passed to the Shell, then you don't have any problems... BTW: What's with the '&' your using right after the daemon.exe? You don't need it there. Just to make the code a little more readable, you might want to take those out, but keep the one in front of 'FileName'. RageInTheMachine9532

        R Offline
        R Offline
        Rip V Winkle
        wrote on last edited by
        #3

        My dumb mistake I was trying to mount the image without having the user type in the location. Thanks RageInTheMachine9532 wrote: BTW: What's with the '&' your using right after the daemon.exe? You don't need it there. Just to make the code a little more readable, you might want to take those out, but keep the one in front of 'FileName'. In VB.Net it requires some sort of connector when writting a string. If you just type: shell("c:\program files\d-tools\daemon.exe" "-unmount 0") it will error out at "-unmount 0" Therefore I put the "&" sign in.

        D 1 Reply Last reply
        0
        • R Rip V Winkle

          My dumb mistake I was trying to mount the image without having the user type in the location. Thanks RageInTheMachine9532 wrote: BTW: What's with the '&' your using right after the daemon.exe? You don't need it there. Just to make the code a little more readable, you might want to take those out, but keep the one in front of 'FileName'. In VB.Net it requires some sort of connector when writting a string. If you just type: shell("c:\program files\d-tools\daemon.exe" "-unmount 0") it will error out at "-unmount 0" Therefore I put the "&" sign in.

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Rip V. Winkle wrote: In VB.Net it requires some sort of connector when writting a string. If you just type: shell("c:\program files\d-tools\daemon.exe" "-unmount 0") it will error out at "-unmount 0" OK. Why are you using two strings? Why not just use the one: shell("c:\program files\d-tools\daemon.exe -unmount 0") RageInTheMachine9532

          R 1 Reply Last reply
          0
          • D Dave Kreskowiak

            Rip V. Winkle wrote: In VB.Net it requires some sort of connector when writting a string. If you just type: shell("c:\program files\d-tools\daemon.exe" "-unmount 0") it will error out at "-unmount 0" OK. Why are you using two strings? Why not just use the one: shell("c:\program files\d-tools\daemon.exe -unmount 0") RageInTheMachine9532

            R Offline
            R Offline
            Rip V Winkle
            wrote on last edited by
            #5

            RageInTheMachine9532 wrote: OK. Why are you using two strings? Why not just use the one: shell("c:\program files\d-tools\daemon.exe -unmount 0") :doh: My bad that was the way I had to do it in my batch file My head is NOT screwed on right.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups