图形命令在直接批处理文件中不可用。我建议你看看 vbscript 或 powershell
有很多指南 - 这是vbscript的帮助文件。是的,它会有所不同。Echo Hello World 会变成 msgbox("Hello World") 并且输入看起来像 inputbox("What is your name?") (在非常基本的层面上)
没有自动转换,除非你有 Visual Studio,否则没有免费的集成开发人员,但notepad++似乎是首选编辑器,因为它的语法突出显示
从这里,一个带有菜单的示例脚本
'-----------------------------------------------------------------
' Name: Menu Template Script
' By: Harvey Colwell
' CopyRight: (c) Jul 2000, All Rights Reserved!
'
'*****************************************************************
Option Explicit
Dim oFS, oWS, oWN
Set oWS = WScript.CreateObject("WScript.Shell")
Set oWN = WScript.CreateObject("WScript.Network")
Set oFS = WScript.CreateObject("Scripting.FileSystemObject")
'----------
' Script SetUp
'----------
'----------
' Main
'----------
Select Case InputBox ( _
"Enter menu item number then Click Ok. . ." & vbCrlf & vbCrlf & _
" [1] Item 1" & vbCrlf & _
" [2] Item 2" & vbCrlf & _
" [3] Item 3" & vbCrlf & _
" [4] Item 4", _
"Main Menu")
Case "1"
Call sub1()
Case "2"
Call sub2()
Case "3"
Call sub3()
Case "4"
Call sub4()
Case Else
WScript.Echo "You entered an invalid menu choice!"
End Select
'----------
' Clean Up
'----------
Call CleanUp
'-----------------------------------------------------------------
' Subroutines
'*****************************************************************
'---------------------
Sub CleanUp()
Set oWS = Nothing
Set oWN = Nothing
Set oFS = Nothing
WScript.Quit
End Sub
'---------------------
Sub sub1()
WScript.Echo "You selected Menu Item 1"
End Sub
'---------------------
Sub sub2()
WScript.Echo "You selected Menu Item 2"
End Sub
'---------------------
Sub sub3()
WScript.Echo "You selected Menu Item 3"
End Sub
'---------------------
Sub sub4()
WScript.Echo "You selected Menu Item 4"
End Sub
'-----------------------------------------------------------------
' Functions
'*****************************************************************
'---------------------
'***************************************