WQL & Parameters

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
 
T

Torgeir Bakken \(MVP\)

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 & "'"
 
A

Aaron

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!
 
T

Torgeir Bakken \(MVP\)

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 :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top