使用批处理写入VBS文件 [英] Writing a VBS file using batch

查看:269
本文介绍了使用批处理写入VBS文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在处理批处理文件时需要帮助,我正在尝试获取批处理文件以为输入框编写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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆