B4J Question Can't handle single and double quotes in same argument

Discussion in 'B4J Questions' started by alienhunter, Sep 7, 2015.

  1. alienhunter

    alienhunter Active Member Licensed User

    Hi
    i get this error " Can't handle single and double quotes in same argument"
    when i try to send a command to shell
    wmic/output: c:\temp\text.html path Win32_Process WHERE "name like 'notepad.exe'" get /format:hform
    since notepad.exe has to single quoted inside of a double quote
    hmmmm
    how can i avoid this error ?
    thanks AH
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Shell parameters cannot include both types of quotes. It is not possible to escape them correctly.

    What exactly are you trying to run?
     
  3. alienhunter

    alienhunter Active Member Licensed User

    Hi ,
    thanks for the response , I am trying to run WMIC_Queries direct from shell , but some work and some not
    because of the escape problem
    I might have to delegate this with small individual batch files and pass the variables ,since this will read from different computers over the network
    if a certain program is running and how much resources it is using .
    It is working with tasklist but WMIC is faster and has more to offer
    AH
     
  4. sorex

    sorex Expert Licensed User

    you can use this aswell

    Code:
    wmic/output: c:\temp\text.html path Win32_Process WHERE (name like 'notepad.exe') get /format:hform
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice