CyberNerd Posted December 1, 2006 Posted December 1, 2006 Simple question - how do I escape " in a vbscript ? I want "this text echoed" including the "
ChrisH Posted December 1, 2006 Posted December 1, 2006 Drives me insane. You usually dou double quotes sometimes triple or single quotes in double quotes. Show me what you want to do it with exactly and I can tell you.
ChrisH Posted December 1, 2006 Posted December 1, 2006 Good good. Check out this fun I had building the command line for a recent image coversion wrapper: StrCMDLine = "c:\imagemagick\convert.exe " & """" & CombinedPath & """" & " " & """" & OutPath & """"
acb_ Posted December 1, 2006 Posted December 1, 2006 Aaaarrggggh!! Escaping quotes in vbs is my arch-nemesis!! :twisted:
ajbritton Posted December 1, 2006 Posted December 1, 2006 If you are starting to lose track of things, then you can always use chr(34)MyCmdLine = "App.exe " & chr(34) & "C:\Path with spaces\file.dat" & chr(34) Sometimes it's easier that way. The other thing I do is to create an Enqote functionfunction Enquote(sSource) Enquote = chr(34) & sSource & chr(34) end function Then you can doMyCmdLine = "App.exe " & Enquote("C:\Path with spaces\file.dat")
acb_ Posted December 1, 2006 Posted December 1, 2006 If you are starting to lose track of things, then you can always use chr(34)MyCmdLine = "App.exe " & chr(34) & "C:\Path with spaces\file.dat" & chr(34) Sometimes it's easier that way. The other thing I do is to create an Enqote functionfunction Enquote(sSource) Enquote = chr(34) & sSource & chr(34) end function Then you can doMyCmdLine = "App.exe " & Enquote("C:\Path with spaces\file.dat") That's a nice approach. Thanks
ajbritton Posted December 1, 2006 Posted December 1, 2006 Just thought of another way...MyCmdLine = Replace("$$C:\Path with spaces\file.dat$$", "$$", chr(34))
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