Jump to content

ComSpec syntax issue


Recommended Posts

Can anyone help me correctly format the following command line? All of my attempts have proven fruitless.

wevtutil qe Application /q:"*[System[Provider[@Name='EMET']]]" /rd:true /c:1 /f:text > c:\EMET.log

Here is what I've tried:

Local $Result = RunWait(@ComSpec & " /c wevtutil.exe qe Application /rd:true /c:1 /q:*[System[Provider[@Name=EMET]]] /f:text > " & $LogFile, @SystemDir, @SW_SHOW)

Local $Result = RunWait(@ComSpec & ' /c wevtutil.exe qe Application / q:" *[System[Provider[@Name = "EMET"]]]" / rd:true / c:1 / f:text > ' & $LogFile, @SystemDir, @SW_HIDE)

Local $Result = RunWait(@ComSpec & " /c wevtutil.exe qe Application / q:"*[System[Provider[@Name='EMET']]]" / rd:true / c:1 / f:text > " & $LogFile, @SystemDir, @SW_HIDE)

Thanks for any suggestions,

-Mike

Link to comment
Share on other sites

Try this:

Local $Result = RunWait(@ComSpec & ' /c wevtutil qe Application /q:"*[System[Provider[@Name=' & "'EMET']]]" & '" /rd:true /c:1 /f:text > c:EMET.log', @SystemDir, @SW_SHOW)

BIMBO!!!

Thanks for the help Andreik, works perfectly! I really need to get a better handle on single and double quotes, this stuff trips me up almost everytime.

-Mike

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...