Jump to content

run with multiple ""


Recommended Posts

Hello,

i am trying to use RUN command with following but cant get it correctly , i am sure this is easy

$cmd = Run(@ComSpec & " /c  typeperf -qx | findstr /C:"Network Interface" | findstr /C:"Bytes Total" ", @SystemDir, @SW_SHOW, $STDERR_CHILD + $STDOUT_CHILD)

Please Advice

Thanks

Link to comment
Share on other sites

I usually use chr(34)... It can sometimes get a little messy, but I always know where I am.

For example:

$cmd = Run(@ComSpec & " /c typeperf -qx | findstr /C:" & chr(34) & "Network Interface" & chr(34) & " | findstr /C:" & chr(34) & "Bytes Total" & chr(34), @SystemDir, @SW_SHOW, $STDERR_CHILD + $STDOUT_CHILD)

You can usually use & _ to signify a new line, for example:

$String = "This is some text " & _

"That sits on one line"

Will give you "This is some text That sits on one line"

Are you telling me something I need to know or something I want to know?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...