zimy Posted April 24, 2006 Share Posted April 24, 2006 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 More sharing options...
Thatsgreat2345 Posted April 24, 2006 Share Posted April 24, 2006 (edited) check it 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 April 24, 2006 by thatsgreat2345 Link to comment Share on other sites More sharing options...
zimy Posted April 24, 2006 Author Share Posted April 24, 2006 Thanks for the pointer, cant believe i missed that. Anywho I'm on the right track now two many quotes Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted April 24, 2006 Share Posted April 24, 2006 hahah yeah there are alot it was troublesome im just like double quote single double single double single good times Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now