China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-04 13:14
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Question about matching quotes in run inside VBS View 720 Replies 4
Original Poster Posted 2007-04-30 03:11 ·  中国 浙江 电信
中级用户
★★
Credits 385
Posts 156
Joined 2007-01-19 02:32
19-year member
UID 76955
Gender Male
Status Offline
Dim Wsh
Set Wsh = WScript.CreateObject("WScript.Shell")
WScript.Sleep(2000)
Wsh.Run "shutdown -r -t 60 -c "DCOM Server Process Launcher service terminated unexpectedly, Windows must restart immediately"",false,false
Set Wsh=NoThing
WScript.quit



How should the quotes on line 4 be matched so this VBS can execute correctly?
Floor 2 Posted 2007-04-30 05:24 ·  中国 新疆 乌鲁木齐 电信
高级用户
★★★
Autowalk
Credits 845
Posts 375
Joined 2007-03-03 01:58
19-year member
UID 80606
Gender Male
Status Offline
Wsh.Run "shutdown -r -t 60 -c","DCOM Server Process Launcher service terminated unexpectedly, Windows must restart immediately",false,false


Try it like this
Floor 3 Posted 2007-04-30 06:03 ·  中国 浙江 宁波 鄞州畅联信息技术有限公司
中级用户
★★
Credits 385
Posts 156
Joined 2007-01-19 02:32
19-year member
UID 76955
Gender Male
Status Offline
Still doesn't work.
Floor 4 Posted 2007-04-30 06:09 ·  中国 河北 保定 联通
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline

Dim Wsh
Set Wsh = WScript.CreateObject("WScript.Shell")
WScript.Sleep(2000)
Wsh.Run "shutdown -r -t 60 -c ""DCOM Server Process Launcher service terminated unexpectedly, Windows must restart immediately""",false,false
Set Wsh=NoThing
WScript.quit
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
heicai +2 2007-04-30 06:13
Floor 5 Posted 2007-04-30 06:14 ·  中国 浙江 宁波 鄞州畅联信息技术有限公司
中级用户
★★
Credits 385
Posts 156
Joined 2007-01-19 02:32
19-year member
UID 76955
Gender Male
Status Offline
Thanks for the answer!
I never would have thought that in the end I needed to add three quotation marks.
Forum Jump: