Jump to content

Quote Escape Character?


zimy
 Share

Recommended Posts

Hi all,

trying to write vbscript using a function and FileWriteLine

however this is the problem i need to use single quotes in the query that I'm doing but i keep getting errors. Was wondering if there are any "escape" characters.

heres the line:

FileWriteLine($pcinfoscript, 'set colInstances = objSWbemServices.ExecQuery("SELECT * FROM MSNdis_80211_ServiceSetIdentifier WHERE Active = True AND InstanceName = & wifiAdapter &)' & @CRLF)

Need it to look like this:

set colInstances = objSwbemServices.ExecQuery _
  ("SELECT * FROM MSNdis_80211_ServiceSetIdentifier WHERE Active = True AND InstanceName ='" & wifiAdapter & "'")

I try the above in scite but like i said it throws an error, im assuming because of the single quote

-zimy

Link to comment
Share on other sites

check it :think: jsut throw in some where u need it to make a new line

& @CRLF &

"'set colInstances = objSWbemServices.ExecQuery(" & '"' & "SELECT * FROM MSNdis_80211_ServiceSetIdentifier WHERE Active = True AND InstanceName = & wifiAdapter &)" & "'" & @CRLF
Edited by thatsgreat2345
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...