zoukankan      html  css  js  c++  java
  • PowerShe 消息提示框测试

    1. 使用powerShell 弹出一个简单的消息框,代码如下,创建test.ps1脚本文件。

    $ConfirmPreference = 'None'
    $ws = New-Object -ComObject WScript.Shell
    $wsr = $ws.popup("The software has installed successfully, please restart your computer to take effect. Press OK to restart later.",0,"Reboot Attention!",0 + 64) 
    

    执行test1.ps1后,电脑右下角会弹出该消息提示框。

    2. 使用VM脚本来提示用户重启电脑,保存脚本为test.bvs, 运行后就可以看到弹出提示框,点yes时,电脑会自动重启:

    Dim return 
    Set R = CreateObject("WScript.Shell") 
    return=MsgBox ("A new software has been installed on your computer, Please restart to take effect.Click OK to restart now, click Cancel to restart later",vbokcancel+vbexclamation,"Attention!") 
    If return=vbok Then 
    R.run("Shutdown.exe -r -t 60") 
    End if
    

      

  • 相关阅读:
    laravel5.6 调用第三方类库
    substring
    SpringSecurity3配置及原理简介
    正则表达式
    type=json
    正则表达式2
    笔记1
    oracle 自带函数大全及例子
    Vector容器类
    HQL
  • 原文地址:https://www.cnblogs.com/rusking/p/10701537.html
Copyright © 2011-2022 走看看