WQL & Parameters

  • Thread starter Thread starter Aaron
  • Start date Start date
A

Aaron

I have a statement like the following in my script; but i'd like the user to
be prompted to input either "Applicable" or "Installed" when starting the
script & have it stored in a variable. What is the correct syntax to
reference the variable in my select statement? I can't seem to get the
quotes right.

"select * from win32_PatchState where status = 'Applicable'"

*******************
strStatus = WScript.StdIn.ReadLine
Help on the following line; i've tried several variations.
"select * from win32_PatchState where status = " & strStatus
 
Aaron said:
I have a statement like the following in my script; but i'd like the user to
be prompted to input either "Applicable" or "Installed" when starting the
script & have it stored in a variable. What is the correct syntax to
reference the variable in my select statement? I can't seem to get the
quotes right.

"select * from win32_PatchState where status = 'Applicable'"

*******************
strStatus = WScript.StdIn.ReadLine
Help on the following line; i've tried several variations.
"select * from win32_PatchState where status = " & strStatus
Hi


"select * from win32_PatchState where status = '" & strStatus & "'"
 
Thanks Torgeir,

You got me thinking in the right direction. Here's what I had to do to make
it work.

strStatus = WScript.StdIn.ReadLine

....

("select * from win32_PatchState where status = " & "'" & strStatus & "'")

Thanks again!
 
Aaron said:
Thanks Torgeir,

You got me thinking in the right direction. Here's what I had to do to make
it work.

strStatus = WScript.StdIn.ReadLine

...

("select * from win32_PatchState where status = " & "'" & strStatus & "'")

would be the same as

("select * from win32_PatchState where status = '" & strStatus & "'")

Thanks again!

Your welcome :-)
 
Back
Top