如何启动与VBS系统文件检查器工具 [英] How to launch System File Checker tool with vbs

查看:196
本文介绍了如何启动与VBS系统文件检查器工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在批处理或CMD,SFC.EXE用一个简单的命令来运行:

In batch or cmd, sfc.exe run with a simple command:

%windir%\system32\SFC.exe /SCANNOW

如何使用.vbs脚本(86 64)运行此命令??

How to run this command with .vbs script (x86 x64)??

感谢

推荐答案

您可以做这样的事情,只是给一试!

You can do something like this, just give a try !

Option Explicit
' Run as Admin
If Not WScript.Arguments.Named.Exists("elevate") Then
    CreateObject("Shell.Application").ShellExecute WScript.FullName _
    , WScript.ScriptFullName & " /elevate", "", "runas", 1
    WScript.Quit
End If
Dim ws,MyCommand,Execution
Set ws = createobject("wscript.shell")
MyCommand = "SFC /SCANNOW"
Execution = ws.run(MyCommand,1,False)

这篇关于如何启动与VBS系统文件检查器工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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