Sign in to follow this  
Followers 0
zimy

Quote Escape Character?

4 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

Thanks for the pointer, cant believe i missed that. Anywho I'm on the right track now two many quotes :think:

Share this post


Link to post
Share on other sites

hahah yeah there are alot it was troublesome im just like double quote single double single double single :think: good times

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
Sign in to follow this  
Followers 0