Jump to content

Runwait with @ComSpec


Recommended Posts

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
Link to comment
Share on other sites

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

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

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

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

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

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

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