0

我有以下命令
"C:\Program Files\File Checksum Integrity Verifier\fciv.exe" -sha1 "D:\new.txt"

如何从 vbscript 运行此命令?有谁能够帮我?

4

1 回答 1

0

VBScript 提供了几种不同的方式来执行命令行,这两种方式都在 WshShell 对象(WScript.Shell)上

使用WshShell.Exec

Dim WshShell, oExec
Set WshShell = CreateObject("WScript.Shell")

Set oExec = WshShell.Exec("""C:\Program Files\File Checksum Integrity Verifier\fciv.exe"" -sha1 ""D:\new.txt""")

Do While oExec.Status = 0
     WScript.Sleep 100
Loop

WScript.Echo oExec.Status

使用WshShell.Run

Dim WshShell
Set WshShell = CreateObject("WScript.Shell")

WshShell.Run """C:\Program Files\File Checksum Integrity Verifier\fciv.exe"" -sha1 ""D:\new.txt""", 1, true
于 2013-05-10T20:40:14.373 回答