【问题标题】:how to make radio button using powershell and function depending upon user inputs?如何根据用户输入使用powershell和功能制作单选按钮?
【发布时间】:2017-02-17 08:23:41
【问题描述】:

我正在为我的计算机设置时间,因为我正在编写三个不同国家/地区的 3 个单选按钮,以便用户可以通过选择其中一个单选按钮来设置时区。

请帮忙。

【问题讨论】:

  • 你可以用 HTA 和 vbscript 做到这一点!
  • 检查 this 并将其称为 call radioButtons.bat opt1 opt2 opt3
  • @Hackoo 你能帮忙解决一下vbscript吗

标签: vb.net powershell batch-file vbscript powershell-2.0


【解决方案1】:

检查 radioButtons.bat 。将它与您的脚本放在同一目录中,您可以尝试以下操作:

@echo off

for /f %%# in ('radioButtons.bat bulgaria cambodia zimbabwe') do set country=%%#

if %country% equ 1 (
    set "timezone=+1"
)

if %country% equ 2 (
    set "timezone=+2"
)

if %country% equ 3 (
    set "timezone=+3"
)

echo %timezone%

它会创建一个像这样的窗口

并将结果打印到控制台,for /f 可以处理它

【讨论】:

  • @FoxZ 更改时区设置,您必须致电tzutil。我认为它需要管理员权限。要简单地更改日期和时间,您可以使用 TIME 命令(更改设置也需要管理员权限。)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-05-13
  • 1970-01-01
  • 2012-01-11
  • 1970-01-01
  • 1970-01-01
  • 2010-11-22
  • 1970-01-01
相关资源
最近更新 更多