Parse Quotation marks
-
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.
-
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.
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 -
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'. RageInTheMachine9532My 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. -
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.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 -
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")
RageInTheMachine9532RageInTheMachine9532 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.