使用批处理写入VBS文件 [英] Writing a VBS file using batch
问题描述
您好,我正在处理批处理文件时需要帮助,我正在尝试获取批处理文件以为输入框编写vbs
Hello i need help with my batch file im working on i'm trying to get a batch file to write a vbs for the input box
`echo B = InputBox("PLEASE ENTER PROMETHEUS PASSWORD") > B14.vbs
echo if B <> "jp030700" then >> B14.vbs
echo h=msgBox("INCORRECT",16,"Prometheus - Verify") >> B14.vbs
echo Set ws=CreateObject("WScript.Shell") >> B14.vbs
echo ws.Run ("TASKKILL.exe /F /IM cmd.exe"), 0 , True >> B14.vbs
echo wscript.Quit >> B14.vbs
echo end if >> B14.vbs
echo if B = "jp030700" then >> B14.vbs
echo end if >> B14.vbs
pause`
我试图将其写入B14.vbs,因为您看到的是我在创建的文件中得到的所有内容B = InputBox("PLEASE ENTER PROMETHEUS PASSWORD")
,没有别的请帮助我
i tried to write this to B14.vbs as you can see all i get is this in the file created B = InputBox("PLEASE ENTER PROMETHEUS PASSWORD")
and nothing else please help me
推荐答案
您非常亲密.如果要批量打印实际的<
或>
而不是将其用作重定向符号,则需要使用^
来转义字符.
You're very close. When you want to print an actual <
or >
in batch instead of using it as a redirection symbol, you need to use ^
to escape the character.
将脚本的第二行更改为echo if B ^<^> "jp030700" then >> B14.vbs
Change the second line of your script to echo if B ^<^> "jp030700" then >> B14.vbs
这篇关于使用批处理写入VBS文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!