DigDeep

Runwait with @ComSpec

7 posts in this topic

#1 ·  Posted (edited)

Hi,

May I please request someone to get this corrected? I think my Inverted commas are going incorrect and getting "Syntax Error".

 

$Result = "C:\Temp\Updates.txt"

RunWait(@ComSpec & " /c 'C:\Program Files\Microsoft Baseline Security Analyzer 2\MBSACLI' /n Password+OS+SQL+IIS /wa /unicode >" & $Result, "", @SW_SHOW)

or anything to make it more shorter as:

$Result = "C:\Temp\Updates.txt"
$Scan = "C:\Program Files\Microsoft Baseline Security Analyzer 2"

RunWait(@ComSpec & " /c " & $Scan & 'MBSACLI /n Password+OS+SQL+IIS /wa /unicode >' & $Result, "", @SW_SHOW)

 

Edited by DigDeep

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

switch your quotes - external is single, internal is double. like this:

RunWait(@ComSpec & ' /c "C:\Program Files\Microsoft Baseline Security Analyzer 2\MBSACLI" /n Password+OS+SQL+IIS /wa /unicode >' & $FilePath1, "", @SW_SHOW)

 

Edited by orbs
1 person likes this

Share this post


Link to post
Share on other sites

still the same error.

Share this post


Link to post
Share on other sites

works for me... what error exactly are you getting?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Error...

Error.jpg

Edited by DigDeep

Share this post


Link to post
Share on other sites

what have you got before and after that line? anything on the output pane?

Share this post


Link to post
Share on other sites

Yeah I have loads of lines. I commented all and now it shows up good.

Thank you.

Share this post


Link to post
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