如何在Windows脚本中获取用户输入(通过对话窗口)? [英] How can I get user input (via a dialog window) in a Windows script?

查看:1395
本文介绍了如何在Windows脚本中获取用户输入(通过对话窗口)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个从CMD提示符运行的简单搜索脚本。它需要首先要求用户输入,例如要搜索什么。

I'd like to create a simple search script that runs from the CMD prompt. It needs to asks for user input first e.g. "what to search".

如何提示用户输入(在cmd中),或打开输入对话框(使用任何标准脚本Windows语言) p>

How can I prompt the user for input (in cmd), or open a input dialog (in any standard scripting Windows language).

推荐答案

在命令提示符下,您可以使用 StdIn

At the command prompt, you can use StdIn:

Wscript.StdOut.Write "Enter a number: "
strNumber = Wscript.StdIn.ReadLine

本文非常全面地介绍了在Windows Scripting中获取用户输入的不同方式。这有点老,但仍然有帮助。

This article is a pretty comprehensive look at different ways of getting user input in Windows Scripting. It's a bit old, but still helpful.

这篇关于如何在Windows脚本中获取用户输入(通过对话窗口)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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