create spaces in vb string

if this command :- Dim pscommand As Command = New Command("MailboxReport -SAID" & r & "-TXTPATH" & q)

is represented into vb like this : - "MailboxReport -SAID11364-TXTPATHC:\WHATEVER".  

How can I spave the command correctly with spaces to produce this result  : -

"MailboxReport -SAID 11364 -TXTPATH C:\WHATEVER".
LVL 6
patelbg2001Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
MacroShadowConnect With a Mentor Commented:
Either like that, or even better and shorter like Rgonzo1971's suggestion.

Also instead of " " you could use chr(32), which represents a space character.
0
 
Rgonzo1971Connect With a Mentor Commented:
Hi,

Maybe

Dim pscommand As Command = New Command("MailboxReport -SAID " & r & " -TXTPATH " & q) 

Open in new window

Regards
0
 
AndyAinscowConnect With a Mentor Freelance programmer / ConsultantCommented:
The & will put the strings together directly.  If you want spaces then just add them into the strings.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
patelbg2001Author Commented:
like this example ?(Sorry for the basic question, I'm relearning since my stroke)

Dim q As String = physicalFolder.ToString
Dim r As String = TextBox1.Text
Dim firstString As String
Dim secondString As String
Dim startString As String
firstString = "-SAID"
secondString = "-TXTPATH"
firstString = firstString & " "
secondString = secondString & " "
firstString = firstString & r
secondString = secondString & q
firstString = firstString & " "
startString =”MailboxReport”
startString=startString & “ “
Dim pipe As Pipeline = rs.CreatePipeline()
Dim pscommand As Command = New Command(startString &  firstString  &  secondString)
pipe.Commands.Add(pscommand)
pipe.Invoke()

Open in new window

0
 
patelbg2001Author Commented:
how would a chr(32) be used?
0
 
MacroShadowCommented:
Dim pscommand As Command = New Command("MailboxReport -SAID" & Strings.Chr(32) & r & Strings.Chr(32) & "-TXTPATH" & Strings.Chr(32) & q)
0
 
patelbg2001Author Commented:
Thanks, I'll remember that for the future.
B.
0
 
MacroShadowCommented:
No prob.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.