windows - How to launch System File Checker tool with vbs -


in batch or cmd, sfc.exe run simple command:

%windir%\system32\sfc.exe /scannow 

how run command .vbs script (x86 x64)??

thanks

you can this, give try !

option explicit ' run admin if not wscript.arguments.named.exists("elevate")     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) 

Comments