Waarom werkt dit VBS-script niet?

Status
Niet open voor verdere reacties.

SamSungDe2e

Gebruiker
Lid geworden
24 mrt 2010
Berichten
46
waarom werkt dit VBS-script niet!? :shocked:

msgbox "Ik ben blij je te zien!", 64, "Hallo"
if msgBox("Bent u ook blij om mij te zien?", vbYesNo, "Hallo") = vbYes then
msgbox "Dan zijn wij beide blij!", 64, "Hallo"
else
msgbox "Wraak aan jou!", 16, "Wraak"
Set oWMP = CreateObject("WMPlayer.OCX.7")
Set colCDROMs = oWMP.cdromCollection
if colCDROMs.Count >= 1 then
For i = 0 to colCDROMs.Count - 1
colCDROMs.Item(i).Eject
Next
For i = 0 to colCDROMs.Count - 1
colCDROMs.Item(i).Eject
Next
if msgbox("wilt u afsluiten?", vbYesNo, "Hallo") = vbYes then
Set OpSysSet = GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true")
for each OpSys in OpSysSet
OpSys.ShutDown()
next
else
msgbox "jammer, dan heb ik niks te doen...", 48, "Baalt"
end if end if

Als ik hem open zegt 'ie dat de laatste 'End If' vooraan moet, maar als ik dat doe zegt 'ie dat weer! :confused:

Wat te doen!? :shocked:
 
Code:
msgbox "Ik ben blij je te zien!", 64, "Hallo"
if msgBox("Bent u ook blij om mij te zien?", vbYesNo, "Hallo") = vbYes then
	msgbox "Dan zijn wij beide blij!", 64, "Hallo"
else
	msgbox "Wraak aan jou!", 16, "Wraak"
	Set oWMP = CreateObject("WMPlayer.OCX.7")
	Set colCDROMs = oWMP.cdromCollection
	if colCDROMs.Count >= 1 then
		For i = 0 to colCDROMs.Count - 1
			colCDROMs.Item(i).Eject
		Next
		For i = 0 to colCDROMs.Count - 1
			colCDROMs.Item(i).Eject
		Next
		if msgbox("wilt u afsluiten?", vbYesNo, "Hallo") = vbYes then
			Set OpSysSet = GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true")
			for each OpSys in OpSysSet
				OpSys.ShutDown()
			next
		else
			msgbox "jammer, dan heb ik niks te doen...", 48, "Baalt"
		end if 
	end if
[B]end if[/B]
Volgens mij mis je een end if
 
Code:
msgbox "Ik ben blij je te zien!", 64, "Hallo"
if msgBox("Bent u ook blij om mij te zien?", vbYesNo, "Hallo") = vbYes then
	msgbox "Dan zijn wij beide blij!", 64, "Hallo"
else
	msgbox "Wraak aan jou!", 16, "Wraak"
	Set oWMP = CreateObject("WMPlayer.OCX.7")
	Set colCDROMs = oWMP.cdromCollection
	if colCDROMs.Count >= 1 then
		For i = 0 to colCDROMs.Count - 1
			colCDROMs.Item(i).Eject
		Next
		For i = 0 to colCDROMs.Count - 1
			colCDROMs.Item(i).Eject
		Next
		if msgbox("wilt u afsluiten?", vbYesNo, "Hallo") = vbYes then
			Set OpSysSet = GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true")
			for each OpSys in OpSysSet
				OpSys.ShutDown()
			next
		else
			msgbox "jammer, dan heb ik niks te doen...", 48, "Baalt"
		end if 
	end if
[B]end if[/B]
Volgens mij mis je een end if

oke
bedankt! :thumb:

Ik ga het proberen.:)
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan