You can use the chr(34) to produce ". So this line
wshShell.Exec("D:\WOL\powe
Would be
wshShell.Exec("D:\WOL\powe
Main Topics
Browse All TopicsGreetings to all,
I'm trying to create a few scripts to automate a Wake On LAN and automatic shutdown in my server farm using the freeware poweroff.exe utility. I have a txt file in my managment server D: which contains all the hostnames, IP's and MAC addresses necessary for the WOL and POL functions. My WOL script is working fine, but my POL script has an error. As you can see from the code attached, I've specified parameters with the poweroff.exe command to include a message in the poweroff.exe command so that any users logged in will be prompted to click the cancel button. However the message must be placed in inverted commas, and as a result is causing a syntax error with the WScript.Shell.Exec("") method.
Is there a way for me to include a message in inverted commas within the WScript.Shell.Exec("") method? I've been trying to find a solution for days but with no success.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
You can use the chr(34) to produce ". So this line
wshShell.Exec("D:\WOL\powe
Would be
wshShell.Exec("D:\WOL\powe
Greetings to all and sorry for the late reply, its a long weekend where I am.
mnialon: When I tried using triple quotes, I still got a vbs error. But when I tried double quotes I didn't get an error? I.e. the line """Computer is shutting down. Click CANCEL to abort.""" doesn't seem to work, but the line ""Computer is shutting down. Click CANCEL to abort."" seems to be accepted.
CodeCruiser: No problems with the code you provided. On my laptop it was able to execute.
I'll be testing the code on the servers once I'm back after the weekend. Will keep you posted as to the results!
Business Accounts
Answer for Membership
by: mnialonPosted on 2009-08-07 at 00:55:48ID: 25040604
if you want to use " in your text, you have to write ""
plus " for beginning of the string, that means you have to write """
(3 times ")
try that :
"""Computer is shutting down. Click CANCEL to abort."""
michel